From 79048e265ef3659f5a5cf103e6afb8e07835bb2d Mon Sep 17 00:00:00 2001 From: wanzirong Date: Wed, 21 Jan 2026 17:37:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E5=B9=B6?= =?UTF-8?q?=E5=8F=91=E7=88=AC=E8=99=AB=E6=95=B0=E9=87=8F=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8F=82=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: From df39d293de891ed1a23fbc87c21ea1f9a4e59045 Mon Sep 17 00:00:00 2001 From: wanzirong Date: Fri, 30 Jan 2026 11:13:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9--max=5Fconcurrency?= =?UTF-8?q?=E4=B8=BA--max=5Fconcurrency=5Fnum,=E4=BF=9D=E6=8C=81=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd_arg/arg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd_arg/arg.py b/cmd_arg/arg.py index bcc53db..266dd84 100644 --- a/cmd_arg/arg.py +++ b/cmd_arg/arg.py @@ -258,10 +258,10 @@ async def parse_cmd(argv: Optional[Sequence[str]] = None): rich_help_panel="Comment Configuration", ), ] = config.CRAWLER_MAX_COMMENTS_COUNT_SINGLENOTES, - max_concurrency: Annotated[ + max_concurrency_num: Annotated[ int, typer.Option( - "--max_concurrency", + "--max_concurrency_num", help="Maximum number of concurrent crawlers", rich_help_panel="Performance Configuration", ), @@ -291,7 +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 + config.MAX_CONCURRENCY_NUM = max_concurrency_num # Set platform-specific ID lists for detail/creator mode if specified_id_list: