diff --git a/cmd_arg/arg.py b/cmd_arg/arg.py index 074dd13..20d1d39 100644 --- a/cmd_arg/arg.py +++ b/cmd_arg/arg.py @@ -382,6 +382,8 @@ async def parse_cmd(argv: Optional[Sequence[str]] = None): config.TIEBA_SPECIFIED_ID_LIST = [ _normalize_tieba_note_id(item) for item in specified_id_list ] + elif platform == PlatformEnum.ZHIHU: + config.ZHIHU_SPECIFIED_ID_LIST = specified_id_list if creator_id_list: if platform == PlatformEnum.XHS: diff --git a/tools/cdp_browser.py b/tools/cdp_browser.py index b674f51..c6d76b9 100644 --- a/tools/cdp_browser.py +++ b/tools/cdp_browser.py @@ -316,10 +316,9 @@ class CDPBrowserManager: """ try: if config.CDP_CONNECT_EXISTING: - # For existing browser (e.g. chrome://inspect/#remote-debugging), - # Chrome exposes a WebSocket at /devtools/browser and may show a confirmation - # dialog to the user. Use ws:// with a longer timeout to wait for user confirmation. - ws_url = f"ws://localhost:{self.debug_port}/devtools/browser" + # Existing Chrome exposes the browser websocket URL from /json/version. + # Newer Chrome versions return a UUID path instead of plain /devtools/browser. + ws_url = await self._get_browser_websocket_url(self.debug_port) utils.logger.info(f"[CDPBrowserManager] Connecting to existing browser via CDP: {ws_url}") utils.logger.info( "[CDPBrowserManager] Please check your browser for a confirmation dialog and accept it"