mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-04-20 10:47:37 +08:00
fix: 修复B站搜索Field命名 bug
refactor: ping接口统一更换为pong
This commit is contained in:
@@ -81,9 +81,9 @@ class XHSClient:
|
||||
return await self.request(method="POST", url=f"{self._host}{uri}",
|
||||
data=json_str, headers=headers)
|
||||
|
||||
async def ping(self) -> bool:
|
||||
async def pong(self) -> bool:
|
||||
"""get a note to check if login state is ok"""
|
||||
utils.logger.info("Begin to ping xhs...")
|
||||
utils.logger.info("Begin to pong xhs...")
|
||||
ping_flag = False
|
||||
try:
|
||||
note_card: Dict = await self.get_note_by_keyword(keyword="小红书")
|
||||
|
||||
@@ -63,7 +63,7 @@ class XiaoHongShuCrawler(AbstractCrawler):
|
||||
|
||||
# Create a client to interact with the xiaohongshu website.
|
||||
self.xhs_client = await self.create_xhs_client(httpx_proxy)
|
||||
if not await self.xhs_client.ping():
|
||||
if not await self.xhs_client.pong():
|
||||
login_obj = XHSLogin(
|
||||
login_type=self.login_type,
|
||||
login_phone=account_phone,
|
||||
|
||||
Reference in New Issue
Block a user