{"record":{"id":"9c87d2ac7be45159","repo":"NanmiCoder/MediaCrawler","slug":"captcha-appeared-request-failed-verifytype-ver","errorCode":null,"errorMessage":"CAPTCHA appeared, request failed, Verifytype: {verify_type}, Verifyuuid: {verify_uuid}, Response: {response}","messagePattern":"CAPTCHA appeared, request failed, Verifytype: (.+?), Verifyuuid: (.+?), Response: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"media_platform/xhs/client.py","lineNumber":164,"sourceCode":"        await self._refresh_proxy_if_expired()\n\n        # return response.text\n        return_response = kwargs.pop(\"return_response\", False)\n        async with make_async_client(proxy=self.proxy) as client:\n            response = await client.request(method, url, timeout=self.timeout, **kwargs)\n\n        if response.status_code in {401, 403, 429}:\n            raise PlatformAccessError(\n                f\"XHS request blocked with HTTP {response.status_code}\"\n            )\n\n        if response.status_code == 471 or response.status_code == 461:\n            # someday someone maybe will bypass captcha\n            verify_type = response.headers[\"Verifytype\"]\n            verify_uuid = response.headers[\"Verifyuuid\"]\n            msg = f\"CAPTCHA appeared, request failed, Verifytype: {verify_type}, Verifyuuid: {verify_uuid}, Response: {response}\"\n            utils.logger.error(msg)\n            raise Exception(msg)\n\n        response_data: Optional[Dict] = None\n        try:\n            candidate_data = response.json()\n            if isinstance(candidate_data, dict):\n                response_data = candidate_data\n        except (TypeError, ValueError):\n            pass\n\n        response_code = (\n            str(response_data.get(\"code\"))\n            if response_data is not None and response_data.get(\"code\") is not None\n            else \"\"\n        )\n        if response_code == str(self.IP_ERROR_CODE):\n            raise IPBlockError(self.IP_ERROR_STR)\n        if response_code == str(self.SECURITY_LIMIT_CODE):\n            raise PlatformAccessError(","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/NanmiCoder/MediaCrawler/blob/d6f7c5bb906b6dac40ddf343ef9e26438a3de092/media_platform/xhs/client.py#L146-L182","documentation":"Raised by XiaoHongShuClient.request when xiaohongshu returns HTTP 471 or 461 - their CAPTCHA/verification challenge statuses. The response headers carry Verifytype and Verifyuuid identifying the challenge. The code deliberately raises a bare Exception (comment: 'someday someone maybe will bypass captcha'), i.e. there is no automated solving path.","triggerScenarios":"Any xhs API call where risk control decides a human check is needed: new IP with no cookie history, high request velocity, or crawler-fingerprint detection. Verifytype/Verifyuuid headers are present on the 471/461 response.","commonSituations":"Datacenter/proxy IP flagged by xiaohongshu; crawling without a logged-in cookie; bursty scraping patterns right after starting a run.","solutions":["Open the same URL in a real browser with the same cookie, complete the CAPTCHA, then re-export the cookie into config.","Rotate to a cleaner proxy IP (or enable ENABLE_IP_PROXY with a residential provider) before retrying.","Slow the crawl: increase delays between requests and reduce concurrency.","Log into an xhs account (cookie login) so requests carry an established session instead of anonymous ones."],"exampleFix":"// before\n# no special handling; Exception propagates and kills the task\n// after\ntry:\n    data = await xhs_client.get(uri, params=params)\nexcept Exception as e:\n    if \"CAPTCHA appeared\" in str(e):\n        await proxy_pool.rotate()  # or signal operator to solve manually\n        await asyncio.sleep(300)\n    raise","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    data = await xhs_client.request(method, uri, **kwargs)\nexcept Exception as e:\n    if \"CAPTCHA appeared\" not in str(e):\n        raise\n    utils.logger.warning(\"xhs captcha - rotating IP and pausing\")\n    await xhs_client._refresh_proxy_if_expired(force=True)\n    await asyncio.sleep(600)","preventionTips":["Use warmed logged-in cookies instead of anonymous sessions.","Prefer residential proxies over datacenter IPs.","Pace requests with jitter; avoid bursts after run start.","There is no built-in captcha solving - plan manual intervention or IP rotation."],"tags":["xhs","captcha","anti-bot","http"],"backgroundTag":null,"analyzedSha":"d6f7c5bb906b6dac40ddf343ef9e26438a3de092","analyzedAt":"2026-08-15T01:39:07.505Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}