From 79048e265ef3659f5a5cf103e6afb8e07835bb2d Mon Sep 17 00:00:00 2001 From: wanzirong Date: Wed, 21 Jan 2026 17:37:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=B9=B6=E5=8F=91?= =?UTF-8?q?=E7=88=AC=E8=99=AB=E6=95=B0=E9=87=8F=E6=8E=A7=E5=88=B6=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 --max_concurrency 命令行参数 - 用于控制并发爬虫数量 - 默认值为 1 --- cmd_arg/arg.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd_arg/arg.py b/cmd_arg/arg.py index 047e4f2..bcc53db 100644 --- a/cmd_arg/arg.py +++ b/cmd_arg/arg.py @@ -258,6 +258,14 @@ async def parse_cmd(argv: Optional[Sequence[str]] = None): rich_help_panel="Comment Configuration", ), ] = config.CRAWLER_MAX_COMMENTS_COUNT_SINGLENOTES, + max_concurrency: Annotated[ + int, + typer.Option( + "--max_concurrency", + help="Maximum number of concurrent crawlers", + rich_help_panel="Performance Configuration", + ), + ] = config.MAX_CONCURRENCY_NUM, ) -> SimpleNamespace: """MediaCrawler 命令行入口""" @@ -283,6 +291,7 @@ async def parse_cmd(argv: Optional[Sequence[str]] = None): config.SAVE_DATA_OPTION = save_data_option.value config.COOKIES = cookies config.CRAWLER_MAX_COMMENTS_COUNT_SINGLENOTES = max_comments_count_singlenotes + config.MAX_CONCURRENCY_NUM = max_concurrency # Set platform-specific ID lists for detail/creator mode if specified_id_list: