{"record":{"id":"6e9ce1884d5ef430","repo":"xtekky/gpt4free","slug":"hcaptcha-accessibility-cookie-required-log-in-at","errorCode":null,"errorMessage":"hCaptcha accessibility cookie required: log in at https://dashboard.hcaptcha.com/signup?type=accessibility in your browser, or pass hc_accessibility=\"...\".","messagePattern":"hCaptcha accessibility cookie required: log in at https://dashboard\\.hcaptcha\\.com/signup\\?type=accessibility in your browser, or pass hc_accessibility=\"\\.\\.\\.\"\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"g4f/Provider/audio/ElevenLabs.py","lineNumber":79,"sourceCode":"        **kwargs,\n    ) -> AsyncResult:\n        prompt = get_last_message(messages, prompt)\n        if not prompt:\n            raise ValueError(\"Prompt is empty.\")\n\n        voice = audio.get(\"voice\", cls.default_voice)\n        model_id = audio.get(\"model\", cls.default_model)\n        output_format = audio.get(\"format\", cls.default_format)\n        language = audio.get(\"language\", cls.default_language)\n\n        # hcaptcha accessibility cookie — kwarg, then browser cookie store\n        cookie_val = kwargs.get(\"hc_accessibility\")\n        if not cookie_val:\n            cookie_val = get_cookies(\n                \".hcaptcha.com\", raise_requirements_error=False\n            ).get(\"hc_accessibility\")\n        if not cookie_val:\n            raise RuntimeError(\n                \"hCaptcha accessibility cookie required: log in at \"\n                \"https://dashboard.hcaptcha.com/signup?type=accessibility \"\n                'in your browser, or pass hc_accessibility=\"...\".'\n            )\n\n        browser, stop_browser = await get_nodriver(proxy=proxy)\n        try:\n            cookie_params = get_cookie_params_from_dict(\n                {\"hc_accessibility\": cookie_val}, domain=\".hcaptcha.com\"\n            )\n            await browser.cookies.set_all(cookie_params)\n\n            page = await browser.get(cls.url)\n            # Wait until DOM body exists before injecting elements\n            await page.evaluate(\n                \"\"\"\n                document.body || new Promise(r => {\n                    document.addEventListener('DOMContentLoaded', r, {once: true});","sourceCodeStart":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/Provider/audio/ElevenLabs.py#L61-L97","documentation":"RuntimeError from ElevenLabs when no hCaptcha accessibility cookie is available. This provider drives a real browser (nodriver) against elevenlabs.io, which is gated by hCaptcha; the accessibility cookie (from signing up at hcaptcha.com's accessibility program) is the only bypass used. It checks kwargs['hc_accessibility'] first, then the browser cookie store for .hcaptcha.com; neither found means the flow cannot proceed.","triggerScenarios":"First-time use on a machine with no prior hcaptcha.com accessibility login in the browser, and no hc_accessibility kwarg passed; or browser profile/cookies cleared.","commonSituations":"Headless servers and CI (no browser cookies); users who never enrolled in hCaptcha's accessibility program; cookie expiring (accessibility cookies periodically rotate and must be refreshed).","solutions":["Sign up at https://dashboard.hcaptcha.com/signup?type=accessibility in your browser, then retry so the cookie is harvested","Pass the cookie directly: create(..., hc_accessibility='your-cookie-value')","Re-obtain the cookie if it expired and pass it via the kwarg on servers without a browser","Use an ElevenLabs API-key provider variant instead of the browser-based one for production"],"exampleFix":"# before\nresp = await client.speech.create(model='ElevenLabs', text='hi')\n\n# after\nresp = await client.speech.create(model='ElevenLabs', text='hi', hc_accessibility=os.environ['HC_ACCESSIBILITY'])","handlingStrategy":"validation","validationCode":"import os\n\ndef has_hcaptcha_cookie():\n    return bool(os.getenv('HC_ACCESSIBILITY'))  # if you pass it explicitly\n# else: first run will lack it — expect RuntimeError once, then browser cookie exists","typeGuard":null,"tryCatchPattern":"try:\n    resp = await client.speech.create(model='ElevenLabs', text=text)\nexcept RuntimeError as e:\n    if 'hCaptcha accessibility cookie' in str(e):\n        raise ConfigError('run hcaptcha accessibility signup once, or pass hc_accessibility')","preventionTips":["Enroll in hCaptcha accessibility once per environment and store the cookie value in secret management","Pass hc_accessibility explicitly on servers without a browser","Remember the cookie expires periodically — automate refresh or alert on this error"],"tags":["elevenlabs","hcaptcha","browser-automation","authentication"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}