Skip to content

Commit

Permalink
fix: weibo creator duplicate bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NanmiCoder committed Nov 13, 2024
1 parent f9e7d56 commit c12a63a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions media_platform/weibo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,10 +353,7 @@ async def get_all_notes_by_creator_id(self, creator_id: str, container_id: str,
utils.logger.error(
f"[WeiboClient.get_notes_by_creator] The current creator may have been banned by xhs, so they cannot access the data.")
break

notes_has_more = notes_res.get("cardlistInfo", {}).get("total", 0) > crawler_total_count
since_id = notes_res.get("cardlistInfo", {}).get("since_id", "0")
crawler_total_count += 10
if "cards" not in notes_res:
utils.logger.info(
f"[WeiboClient.get_all_notes_by_creator] No 'notes' key found in response: {notes_res}")
Expand All @@ -370,5 +367,7 @@ async def get_all_notes_by_creator_id(self, creator_id: str, container_id: str,
await callback(notes)
await asyncio.sleep(crawl_interval)
result.extend(notes)
crawler_total_count += 10
notes_has_more = notes_res.get("cardlistInfo", {}).get("total", 0) > crawler_total_count
return result

0 comments on commit c12a63a

Please sign in to comment.