From 90f72536ba9862bf3e2cc77a5757b362a5bc24d4 Mon Sep 17 00:00:00 2001 From: wanzirong Date: Wed, 21 Jan 2026 16:30:07 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=AE=80=E5=8C=96=E5=91=BD?= =?UTF-8?q?=E4=BB=A4=E8=A1=8C=E5=8F=82=E6=95=B0=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 --max_comments_per_post 重命名为 --max_comments_count_singlenotes,与配置项名称保持一致 - 移除 --xhs_sort_type 参数(暂不需要) - 保持代码简洁,减少不必要的功能 --- cmd_arg/arg.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/cmd_arg/arg.py b/cmd_arg/arg.py index 8e7c360..047e4f2 100644 --- a/cmd_arg/arg.py +++ b/cmd_arg/arg.py @@ -250,22 +250,14 @@ async def parse_cmd(argv: Optional[Sequence[str]] = None): rich_help_panel="Basic Configuration", ), ] = "", - max_comments_per_post: Annotated[ + max_comments_count_singlenotes: Annotated[ int, typer.Option( - "--max_comments_per_post", + "--max_comments_count_singlenotes", help="Maximum number of first-level comments to crawl per post/video", rich_help_panel="Comment Configuration", ), ] = config.CRAWLER_MAX_COMMENTS_COUNT_SINGLENOTES, - xhs_sort_type: Annotated[ - str, - typer.Option( - "--xhs_sort_type", - help="XiaoHongShu sort type (e.g., popularity_descending, time_descending)", - rich_help_panel="Platform Specific Configuration", - ), - ] = "", ) -> SimpleNamespace: """MediaCrawler 命令行入口""" @@ -290,11 +282,7 @@ async def parse_cmd(argv: Optional[Sequence[str]] = None): config.CDP_HEADLESS = enable_headless config.SAVE_DATA_OPTION = save_data_option.value config.COOKIES = cookies - config.CRAWLER_MAX_COMMENTS_COUNT_SINGLENOTES = max_comments_per_post - - # Set XiaoHongShu sort type if specified - if xhs_sort_type and platform == PlatformEnum.XHS: - config.SORT_TYPE = xhs_sort_type + config.CRAWLER_MAX_COMMENTS_COUNT_SINGLENOTES = max_comments_count_singlenotes # Set platform-specific ID lists for detail/creator mode if specified_id_list: