From 90280a261af2e9a1a7a4612f59c664637350b0ed Mon Sep 17 00:00:00 2001 From: ouzhuowei <190020754@qq.com> Date: Fri, 6 Feb 2026 09:58:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E4=BB=A3=E7=90=86=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=9A=84arp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: ouzhuowei <190020754@qq.com> --- cmd_arg/arg.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/cmd_arg/arg.py b/cmd_arg/arg.py index 47b53ff..e27d45a 100644 --- a/cmd_arg/arg.py +++ b/cmd_arg/arg.py @@ -274,12 +274,38 @@ async def parse_cmd(argv: Optional[Sequence[str]] = None): rich_help_panel="Storage Configuration", ), ] = config.SAVE_DATA_PATH, + enable_ip_proxy: Annotated[ + str, + typer.Option( + "--enable_ip_proxy", + help="Whether to enable IP proxy, supports yes/true/t/y/1 or no/false/f/n/0", + rich_help_panel="Proxy Configuration", + show_default=True, + ), + ] = str(config.ENABLE_IP_PROXY), + ip_proxy_pool_count: Annotated[ + int, + typer.Option( + "--ip_proxy_pool_count", + help="IP proxy pool count", + rich_help_panel="Proxy Configuration", + ), + ] = config.IP_PROXY_POOL_COUNT, + ip_proxy_provider_name: Annotated[ + str, + typer.Option( + "--ip_proxy_provider_name", + help="IP proxy provider name (kuaidaili | wandouhttp)", + rich_help_panel="Proxy Configuration", + ), + ] = config.IP_PROXY_PROVIDER_NAME, ) -> SimpleNamespace: """MediaCrawler 命令行入口""" enable_comment = _to_bool(get_comment) enable_sub_comment = _to_bool(get_sub_comment) enable_headless = _to_bool(headless) + enable_ip_proxy_value = _to_bool(enable_ip_proxy) init_db_value = init_db.value if init_db else None # Parse specified_id and creator_id into lists @@ -301,6 +327,9 @@ async def parse_cmd(argv: Optional[Sequence[str]] = None): config.CRAWLER_MAX_COMMENTS_COUNT_SINGLENOTES = max_comments_count_singlenotes config.MAX_CONCURRENCY_NUM = max_concurrency_num config.SAVE_DATA_PATH = save_data_path + config.ENABLE_IP_PROXY = enable_ip_proxy_value + config.IP_PROXY_POOL_COUNT = ip_proxy_pool_count + config.IP_PROXY_PROVIDER_NAME = ip_proxy_provider_name # Set platform-specific ID lists for detail/creator mode if specified_id_list: