fix 二级评论爬取bug

This commit is contained in:
HIRO 2024-06-13 15:57:09 +08:00
parent fd7407cc29
commit 1d224999af
1 changed files with 3 additions and 2 deletions

View File

@ -247,9 +247,10 @@ class KuaiShouClient(AbstractApiClient):
comments_res = await self.get_video_sub_comments( comments_res = await self.get_video_sub_comments(
photo_id, root_comment_id, sub_comment_pcursor photo_id, root_comment_id, sub_comment_pcursor
) )
sub_comment_pcursor = comments_res.get("pcursor", "no_more") vision_sub_comment_list = comments_res.get("visionSubCommentList",{})
sub_comment_pcursor = vision_sub_comment_list.get("pcursor", "no_more")
comments = comments_res.get("subComments", []) comments = vision_sub_comment_list.get("subComments", {})
if callback: if callback:
await callback(photo_id, comments) await callback(photo_id, comments)
await asyncio.sleep(crawl_interval) await asyncio.sleep(crawl_interval)