Skip to content

Commit

Permalink
Update comment.md
Browse files Browse the repository at this point in the history
未登陆时只能获取到前20条评论,此时增加页码会导致c为空字典
  • Loading branch information
kawaiior authored Jul 25, 2024
1 parent 499ed6e commit 45ed6c2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/examples/comment.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ async def main():
while True:
# 获取评论
c = await comment.get_comments(418788911, comment.CommentResourceType.VIDEO, page)

replies = c['replies']
if replies is None:
# 未登陆时只能获取到前20条评论
# 此时增加页码会导致c为空字典
break

# 存储评论
comments.extend(c['replies'])
comments.extend(replies)
# 增加已获取数量
count += c['page']['size']
# 增加页码
Expand Down

0 comments on commit 45ed6c2

Please sign in to comment.