{"record":{"id":"fa305648455a804c","repo":"Panniantong/Agent-Reach","slug":"automatic-browser-extraction-is-disabled-for-spec","errorCode":null,"errorMessage":"Automatic browser extraction is disabled for {spec['name']}. Export the required cookies with Cookie-Editor, then use `agent-reach configure {manual_key}`.","messagePattern":"Automatic browser extraction is disabled for (.+?)\\. Export the required cookies with Cookie-Editor, then use `agent-reach configure (.+?)`\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent_reach/cookie_extract.py","lineNumber":202,"sourceCode":"        raise ValueError(\n            \"platform is required for browser-cookie extraction; \"\n            f\"choose one of: {', '.join(_PLATFORM_SPECS_BY_KEY)}\"\n        )\n    key = platform.lower()\n    try:\n        return _PLATFORM_SPECS_BY_KEY[key]\n    except KeyError as exc:\n        raise ValueError(\n            f\"Unsupported platform: {scrub_url_credentials(platform)}. \"\n            f\"Supported: {', '.join(_PLATFORM_SPECS_BY_KEY)}\"\n        ) from exc\n\n\ndef _require_browser_extractable(spec: PlatformSpec) -> None:\n    \"\"\"Reject platforms whose project policy requires a manual cookie export.\"\"\"\n    manual_key = _COOKIE_EDITOR_ONLY.get(spec[\"config_key\"])\n    if manual_key:\n        raise ValueError(\n            f\"Automatic browser extraction is disabled for {spec['name']}. \"\n            \"Export the required cookies with Cookie-Editor, then use \"\n            f\"`agent-reach configure {manual_key}`.\"\n        )\n\n\ndef extract_all(\n    browser: str = \"chrome\",\n    *,\n    platform: Optional[str] = None,\n    profile: Optional[str] = None,\n) -> Dict[str, dict]:\n    \"\"\"\n    Extract cookies for one explicitly requested platform.\n\n    The legacy function name is retained for API compatibility, but an\n    all-platform read is intentionally no longer supported.\n","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/Panniantong/Agent-Reach/blob/93ae1d18c37b707dec053c7c4f9d91cd8ef8943d/agent_reach/cookie_extract.py#L184-L220","documentation":"Raised by _require_browser_extractable() in agent_reach/cookie_extract.py for platforms whose policy forbids automatic browser extraction. _COOKIE_EDITOR_ONLY maps 'twitter' -> 'twitter-cookies' and 'xhs' -> 'xhs-cookies': these platforms require a manual Cookie-Editor browser export (per project rules, Cookie-Editor export only, no QR login) instead of scraping the cookie store.","triggerScenarios":"Calling extract_all(browser='chrome', platform='twitter') or platform='xhs' — automatic extraction is hard-disabled for these two regardless of browser or profile.","commonSituations":"Trying to automate XHS/Twitter login per the cookie-based auth flow; scripts written for bilibili/xueqiu being reused for twitter/xhs; not knowing the project policy excludes these platforms from rookiepy/browser_cookie3 reads.","solutions":["Install the Cookie-Editor browser extension, export the site cookies as JSON, then run `agent-reach configure twitter-cookies` (or xhs-cookies)","Do not attempt QR-code login for XHS — it hangs by design; Cookie-Editor export is the only supported path","Keep using extract_all only for bilibili and xueqiu"],"exampleFix":"# before\nextract_all(browser='chrome', platform='xhs')  # ValueError: disabled\n\n# after\n# 1. Cookie-Editor extension -> Export (JSON) on xiaohongshu.com\n# 2. CLI: agent-reach configure xhs-cookies","handlingStrategy":"validation","validationCode":"COOKIE_EDITOR_ONLY = {'twitter', 'xhs'}\nif platform.lower() in COOKIE_EDITOR_ONLY:\n    raise ValueError('use Cookie-Editor export + agent-reach configure')","typeGuard":"def auto_extractable(platform: str) -> bool:\n    return platform.lower() in {'bilibili', 'xueqiu'}","tryCatchPattern":"try:\n    extract_all(browser=b, platform=platform)\nexcept ValueError as e:\n    if 'disabled' in str(e):\n        # switch to the manual Cookie-Editor configuration flow\n        run_cookie_editor_flow(platform)\n    else:\n        raise","preventionTips":["Design your auth UX around Cookie-Editor export for twitter/xhs from the start","Never script QR login for XHS — it hangs","Gate extract_all calls behind auto_extractable()"],"tags":["cookies","policy","auth","twitter","xhs"],"backgroundTag":null,"analyzedSha":"93ae1d18c37b707dec053c7c4f9d91cd8ef8943d","analyzedAt":"2026-08-14T22:54:06.735Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}