mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-05-31 23:17:28 +08:00
feat: 启动任务接口添加帖子/视频数量与评论数量覆盖支持
This commit is contained in:
@@ -71,6 +71,8 @@ class CrawlerStartRequest(BaseModel):
|
||||
save_option: SaveDataOptionEnum = SaveDataOptionEnum.JSONL
|
||||
cookies: str = ""
|
||||
headless: bool = False
|
||||
max_notes_count: Optional[int] = None
|
||||
max_comments_count: Optional[int] = None
|
||||
|
||||
|
||||
class CrawlerStatusResponse(BaseModel):
|
||||
|
||||
@@ -225,6 +225,12 @@ class CrawlerManager:
|
||||
cmd.extend(["--get_comment", "true" if config.enable_comments else "false"])
|
||||
cmd.extend(["--get_sub_comment", "true" if config.enable_sub_comments else "false"])
|
||||
|
||||
if config.max_notes_count is not None:
|
||||
cmd.extend(["--crawler_max_notes_count", str(config.max_notes_count)])
|
||||
|
||||
if config.max_comments_count is not None:
|
||||
cmd.extend(["--max_comments_count_singlenotes", str(config.max_comments_count)])
|
||||
|
||||
if config.cookies:
|
||||
cmd.extend(["--cookies", config.cookies])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user