fix: 修复爬取视频/帖子最大数设置值较低导致不爬取的问题

This commit is contained in:
leantli
2024-04-03 12:18:23 +08:00
parent e4836847cd
commit 133f978477
5 changed files with 5 additions and 5 deletions

View File

@@ -96,7 +96,7 @@ class XiaoHongShuCrawler(AbstractCrawler):
async def search(self) -> None:
"""Search for notes and retrieve their comment information."""
utils.logger.info("[XiaoHongShuCrawler.search] Begin search xiaohongshu keywords")
xhs_limit_count = 20 # xhs limit page fixed value
xhs_limit_count = min(20, max(1, config.CRAWLER_MAX_NOTES_COUNT)) # xhs limit page fixed value
for keyword in config.KEYWORDS.split(","):
utils.logger.info(f"[XiaoHongShuCrawler.search] Current search keyword: {keyword}")
page = 1