ytdl-org/youtube-dl · error · ExtractorError

clean_html(payload[0][1:-1])

Error message

clean_html(payload[0][1:-1])

What it means

VK's internal _download_payload helper raises this when the JSON payload from vk.com/<module>.php returns code '8'. In that case payload[0] carries an HTML error fragment, which is cleaned via clean_html(payload[0][1:-1]) and raised as an expected ExtractorError. The visible message is whatever VK put in that fragment (not the literal placeholder).

Solutions

  1. Read the cleaned HTML text in the raised message — it is VK's own error explanation
  2. Open the VK page in a browser to see the underlying access problem (removal, region, login)
  3. Update youtube-dl/yt-dlp; VK's AJAX payload contract changes over time
Defensive patterns

Strategy: try-catch

Try / catch

from youtube_dl.utils import ExtractorError
try:
    ydl.extract_info(url)
except ExtractorError as e:
    vk_msg = str(e)
    if 'removed' in vk_msg or 'deleted' in vk_msg:
        blacklist(url)
    else:
        log('VK payload error: %s' % vk_msg)

Prevention

When it happens

Trigger: POSTing al=1 AJAX requests to vk.com (e.g. video retrieval via video_ext or similar modules) where the response payload code is '8' — typically an application-level error such as content removal or access restrictions.

Common situations: Video removed or region-blocked; account lacks access to the content; VK changed its internal payload codes so the '8' branch fires more often.

Related errors


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

Appendix: source

Thrown at youtube_dl/extractor/vk.py:74

            data=urlencode_postdata(login_form))

        if re.search(r'onLoginFailed', login_page):
            raise ExtractorError(
                'Unable to login, incorrect username and/or password', expected=True)

    def _real_initialize(self):
        self._login()

    def _download_payload(self, path, video_id, data, fatal=True):
        data['al'] = 1
        code, payload = self._download_json(
            'https://vk.com/%s.php' % path, video_id,
            data=urlencode_postdata(data), fatal=fatal,
            headers={'X-Requested-With': 'XMLHttpRequest'})['payload']
        if code == '3':
            self.raise_login_required()
        elif code == '8':
            raise ExtractorError(clean_html(payload[0][1:-1]), expected=True)
        return payload


class VKIE(VKBaseIE):
    IE_NAME = 'vk'
    IE_DESC = 'VK'
    _VALID_URL = r'''(?x)
                    https?://
                        (?:
                            (?:
                                (?:(?:m|new)\.)?vk\.com/video_|
                                (?:www\.)?daxab.com/
                            )
                            ext\.php\?(?P<embed_query>.*?\boid=(?P<oid>-?\d+).*?\bid=(?P<id>\d+).*)|
                            (?:
                                (?:(?:m|new)\.)?vk\.com/(?:.+?\?.*?z=)?video|
                                (?:www\.)?daxab.com/embed/
                            )

View on GitHub (pinned to 956b8c5855)