{"record":{"id":"f91691ce717be425","repo":"ytdl-org/youtube-dl","slug":"yandexmusic-has-considered-youtube-dl-requests-aut","errorCode":null,"errorMessage":"YandexMusic has considered youtube-dl requests automated and asks you to solve a CAPTCHA. You can either wait for some time until unblocked and optionally use --sleep-interval in future or alternatively you can go to https://music.yandex.ru/ solve CAPTCHA, then export cookies and pass cookie file to youtube-dl with --cookies","messagePattern":"YandexMusic has considered youtube-dl requests automated and asks you to solve a CAPTCHA\\. You can either wait for some time until unblocked and optionally use --sleep-interval in future or alternatively you can go to https://music\\.yandex\\.ru/ solve CAPTCHA, then export cookies and pass cookie file to youtube-dl with --cookies","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/yandexmusic.py","lineNumber":32,"sourceCode":"    try_get,\n)\n\n\nclass YandexMusicBaseIE(InfoExtractor):\n    _VALID_URL_BASE = r'https?://music\\.yandex\\.(?P<tld>ru|kz|ua|by|com)'\n\n    @staticmethod\n    def _handle_error(response):\n        if isinstance(response, dict):\n            error = response.get('error')\n            if error:\n                raise ExtractorError(error, expected=True)\n            if response.get('type') == 'captcha' or 'captcha' in response:\n                YandexMusicBaseIE._raise_captcha()\n\n    @staticmethod\n    def _raise_captcha():\n        raise ExtractorError(\n            'YandexMusic has considered youtube-dl requests automated and '\n            'asks you to solve a CAPTCHA. You can either wait for some '\n            'time until unblocked and optionally use --sleep-interval '\n            'in future or alternatively you can go to https://music.yandex.ru/ '\n            'solve CAPTCHA, then export cookies and pass cookie file to '\n            'youtube-dl with --cookies',\n            expected=True)\n\n    def _download_webpage_handle(self, *args, **kwargs):\n        webpage = super(YandexMusicBaseIE, self)._download_webpage_handle(*args, **kwargs)\n        if 'Нам очень жаль, но&nbsp;запросы, поступившие с&nbsp;вашего IP-адреса, похожи на&nbsp;автоматические.' in webpage:\n            self._raise_captcha()\n        return webpage\n\n    def _download_json(self, *args, **kwargs):\n        response = super(YandexMusicBaseIE, self)._download_json(*args, **kwargs)\n        self._handle_error(response)\n        return response","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/yandexmusic.py#L14-L50","documentation":"Raised by YandexMusicBaseIE when the service decides requests are automated: either an API response has type == 'captcha' or a 'captcha' key, or a downloaded webpage contains the Russian 'requests from your IP look automatic' notice. The long message instructs the user to wait, use --sleep-interval, or solve the CAPTCHA in a browser and supply cookies.","triggerScenarios":"Hammering music.yandex.* endpoints so the API starts returning captcha-typed responses, or the page HTML contains the Russian IP-block notice; both paths funnel into _raise_captcha.","commonSituations":"Batch-downloading playlists without delays; shared/cloud IPs already flagged by Yandex; CI runners whose egress IPs look bot-like.","solutions":["Solve the CAPTCHA at https://music.yandex.ru/ in a browser, export cookies, and pass them with --cookies.","Use --sleep-interval (and --max-sleep-interval) to slow requests below detection thresholds.","Wait some time for the IP block to lift, or switch egress IP.","Reduce batch size and avoid parallel downloads against Yandex."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    info = ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'CAPTCHA' in str(e):\n        pause_pipeline()\n        prompt_user_for_cookies()\n        requeue_after.cookies_updated(url)\n    else:\n        raise","preventionTips":["Always set --sleep-interval / --max-sleep-interval when downloading from Yandex Music.","Solve the CAPTCHA once in a browser, export cookies, and pass them via --cookies.","Avoid parallel workers against music.yandex.*; sequential slow requests stay under detection."],"tags":["captcha","rate-limit","anti-bot","cookies","extractor","yandex"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}