fix: 微博登录问题修复

feat: 微博二级评论
This commit is contained in:
Relakkes
2024-08-05 00:48:42 +08:00
parent 7229d29123
commit 1c2237a66f
7 changed files with 62 additions and 54 deletions

View File

@@ -69,8 +69,6 @@ class WeiboCrawler(AbstractCrawler):
context_page=self.context_page,
cookie_str=config.COOKIES
)
await self.context_page.goto(self.index_url)
await asyncio.sleep(1)
await login_obj.begin()
# 登录成功后重定向到手机端的网站再更新手机端登录成功的cookie
@@ -192,7 +190,7 @@ class WeiboCrawler(AbstractCrawler):
utils.logger.info(f"[WeiboCrawler.get_note_comments] begin get note_id: {note_id} comments ...")
await self.wb_client.get_note_all_comments(
note_id=note_id,
crawl_interval=random.randint(1,10), # 微博对API的限流比较严重所以延时提高一些
crawl_interval=random.randint(1,3), # 微博对API的限流比较严重所以延时提高一些
callback=weibo_store.batch_update_weibo_note_comments
)
except DataFetchError as ex: