ytdl-org/youtube-dl · error · ExtractorError

You are trying to log in from an unusual location. You shoul

Error message

You are trying to log in from an unusual location. You should confirm ownership at vk.com to log in with this IP.

What it means

VK-specific anti-fraud error: the video_ext.php response contains a marker redirecting to login.php with act=security_check, meaning VK requires ownership confirmation because the login attempt came from an unusual location/IP. Raised with expected=True by VKIE.

Source

Thrown at youtube_dl/extractor/vk.py:344

            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.',

                r'<!>Unknown error':
                'Video %s does not exist.',

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Log into vk.com from the same IP in a browser and complete the security check (confirm ownership)
  2. Extract without account credentials if the content is public
  3. Run the tool from a residential IP matching the account's usual location
Defensive patterns

Strategy: fallback

Try / catch

from youtube_dl.utils import ExtractorError
try:
    ydl.extract_info(url)
except ExtractorError as e:
    if 'unusual location' in str(e):
        # fall back to anonymous extraction of public content
        opts.pop('username', None); opts.pop('password', None)
        youtube_dl.YoutubeDL(opts).extract_info(url)

Prevention

When it happens

Trigger: Extracting VK content while logged in (or via cookies) from an IP that VK's fraud system flags, so the embed page matches r'<!>/login\.php\?.*\bact=security_check'.

Common situations: Running youtube-dl on a server/VPN/datacenter IP while using an account registered elsewhere; traveling; shared proxies.

Related errors


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