ytdl-org/youtube-dl · error · ExtractorError

error_message

Error message

error_message

What it means

Raised by VKIE when the embedded video page (vk.com/video_ext.php?...) contains a styled error div matching class 'video_layer_message' or id 'video_ext_msg'. The regex-extracted text becomes the error message (the tag name in the report is a placeholder, not the literal text). Expected=True.

Source

Thrown at youtube_dl/extractor/vk.py:341

                data['list'] = list_id

            payload = self._download_payload('al_video', video_id, data)
            info_page = payload[1]
            opts = payload[-1]
            mv_data = opts.get('mvData') or {}
            player = opts.get('player') or {}
        else:
            video_id = '%s_%s' % (mobj.group('oid'), mobj.group('id'))

            info_page = self._download_webpage(
                'http://vk.com/video_ext.php?' + mobj.group('embed_query'), video_id)

            error_message = self._html_search_regex(
                [r'(?s)<!><div[^>]+class="video_layer_message"[^>]*>(.+?)</div>',
                    r'(?s)<div[^>]+id="video_ext_msg"[^>]*>(.+?)</div>'],
                info_page, 'error message', default=None)
            if error_message:
                raise ExtractorError(error_message, expected=True)

            if re.search(r'<!>/login\.php\?.*\bact=security_check', info_page):
                raise ExtractorError(
                    'You are trying to log in from an unusual location. You should confirm ownership at vk.com to log in with this IP.',
                    expected=True)

            ERROR_COPYRIGHT = 'Video %s has been removed from public access due to rightholder complaint.'

            ERRORS = {
                r'>Видеозапись .*? была изъята из публичного доступа в связи с обращением правообладателя.<':
                ERROR_COPYRIGHT,

                r'>The video .*? was removed from public access by request of the copyright holder.<':
                ERROR_COPYRIGHT,

                r'<!>Please log in or <':
                'Video %s is only available for registered users, '
                'use --username and --password options to provide account credentials.',

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Check the message text: it states VK's reason (deleted, removed, private)
  2. Open the video URL in a browser to confirm its current status
  3. If it says login is needed, supply credentials or cookies so the embed shows content
Defensive patterns

Strategy: try-catch

Try / catch

from youtube_dl.utils import ExtractorError
try:
    ydl.extract_info(url)
except ExtractorError as e:
    if 'video_layer' not in str(e) and 'video_ext' not in str(e):
        raise
    log('VK says: %s — dropping %s' % (e, url))

Prevention

When it happens

Trigger: Downloading a VK video whose embed page renders an error notice — deleted video, removed by rightholder, login required — detected by the two _html_search_regex patterns on the video_ext.php response.

Common situations: Deleted or made-private videos; copyright takedowns; following stale links from forums/playlists.

Related errors


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