ytdl-org/youtube-dl · error · ExtractorError

YandexMusic has considered youtube-dl requests automated and

Error message

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

What it means

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.

Source

Thrown at youtube_dl/extractor/yandexmusic.py:32

    try_get,
)


class YandexMusicBaseIE(InfoExtractor):
    _VALID_URL_BASE = r'https?://music\.yandex\.(?P<tld>ru|kz|ua|by|com)'

    @staticmethod
    def _handle_error(response):
        if isinstance(response, dict):
            error = response.get('error')
            if error:
                raise ExtractorError(error, expected=True)
            if response.get('type') == 'captcha' or 'captcha' in response:
                YandexMusicBaseIE._raise_captcha()

    @staticmethod
    def _raise_captcha():
        raise ExtractorError(
            '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',
            expected=True)

    def _download_webpage_handle(self, *args, **kwargs):
        webpage = super(YandexMusicBaseIE, self)._download_webpage_handle(*args, **kwargs)
        if 'Нам очень жаль, но&nbsp;запросы, поступившие с&nbsp;вашего IP-адреса, похожи на&nbsp;автоматические.' in webpage:
            self._raise_captcha()
        return webpage

    def _download_json(self, *args, **kwargs):
        response = super(YandexMusicBaseIE, self)._download_json(*args, **kwargs)
        self._handle_error(response)
        return response

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Solve the CAPTCHA at https://music.yandex.ru/ in a browser, export cookies, and pass them with --cookies.
  2. Use --sleep-interval (and --max-sleep-interval) to slow requests below detection thresholds.
  3. Wait some time for the IP block to lift, or switch egress IP.
  4. Reduce batch size and avoid parallel downloads against Yandex.
Defensive patterns

Strategy: retry

Try / catch

try:
    info = ydl.extract_info(url)
except ExtractorError as e:
    if 'CAPTCHA' in str(e):
        pause_pipeline()
        prompt_user_for_cookies()
        requeue_after.cookies_updated(url)
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: Batch-downloading playlists without delays; shared/cloud IPs already flagged by Yandex; CI runners whose egress IPs look bot-like.

Related errors


AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14). Data as JSON: /api/errors/f91691ce717be425. Report an issue: GitHub.