fix: 修复B站搜索Field命名 bug

refactor: ping接口统一更换为pong
This commit is contained in:
Relakkes
2023-12-05 22:47:36 +08:00
parent 6ae511bb52
commit a6e877de42
7 changed files with 17 additions and 10 deletions

View File

@@ -86,7 +86,7 @@ class DOUYINClient:
return await self.request(method="POST", url=f"{self._host}{uri}", data=data, headers=headers)
@staticmethod
async def ping(browser_context: BrowserContext) -> bool:
async def pong(browser_context: BrowserContext) -> bool:
_, cookie_dict = utils.convert_cookies(await browser_context.cookies())
# todo send some api to test login status
return cookie_dict.get("LOGIN_STATUS") == "1"

View File

@@ -54,7 +54,7 @@ class DouYinCrawler(AbstractCrawler):
await self.context_page.goto(self.index_url)
self.dy_client = await self.create_douyin_client(httpx_proxy)
if not await self.dy_client.ping(browser_context=self.browser_context):
if not await self.dy_client.pong(browser_context=self.browser_context):
login_obj = DouYinLogin(
login_type=self.login_type,
login_phone=account_phone,