ytdl-org/youtube-dl · error · ExtractorError

Error while getting the playlist

Error message

Error while getting the playlist

What it means

Raised by the Wistia extractor when the embed config JSON (fast.wistia.com/embed/<type>s/<id>.json) is a dict containing a truthy 'error' key. Wistia returns such an object when the media or playlist ID is unknown, deleted, or access-restricted, and the extractor converts it to a generic 'Error while getting the playlist' message.

Source

Thrown at youtube_dl/extractor/wistia.py:28

    try_get,
    unescapeHTML,
)


class WistiaBaseIE(InfoExtractor):
    _VALID_ID_REGEX = r'(?P<id>[a-z0-9]{10})'
    _VALID_URL_BASE = r'https?://(?:fast\.)?wistia\.(?:net|com)/embed/'
    _EMBED_BASE_URL = 'http://fast.wistia.com/embed/'

    def _download_embed_config(self, config_type, config_id, referer):
        base_url = self._EMBED_BASE_URL + '%ss/%s' % (config_type, config_id)
        embed_config = self._download_json(
            base_url + '.json', config_id, headers={
                'Referer': referer if referer.startswith('http') else base_url,  # Some videos require this.
            })

        if isinstance(embed_config, dict) and embed_config.get('error'):
            raise ExtractorError(
                'Error while getting the playlist', expected=True)

        return embed_config

    def _extract_media(self, embed_config):
        data = embed_config['media']
        video_id = data['hashedId']
        title = data['name']

        formats = []
        thumbnails = []
        for a in data['assets']:
            aurl = a.get('url')
            if not aurl:
                continue
            astatus = a.get('status')
            atype = a.get('type')
            if (astatus is not None and astatus != 2) or atype in ('preview', 'storyboard'):

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Verify the 10-character media/playlist hashed ID in the URL is still valid by opening the embed page.
  2. If the video was deleted or made private on Wistia, no download is possible without owner access.
  3. Fetch the JSON directly (fast.wistia.com/embed/medias/<id>.json) to inspect the raw error Wistia returns.
  4. Report an extractor bug only if the raw JSON is error-free while youtube-dl still fails.
Defensive patterns

Strategy: validation

Validate before calling

import re, urllib.request
if not re.fullmatch(r'[a-z0-9]{10}', media_id):
    print('invalid Wistia hashed ID — will fail')
else:
    cfg = json.load(urllib.request.urlopen(f'http://fast.wistia.com/embed/medias/{media_id}.json'))
    if isinstance(cfg, dict) and cfg.get('error'):
        print('Wistia reports an error for this ID')

Type guard

def wistia_config_ok(config) -> bool:
    return isinstance(config, dict) and not config.get('error') and 'media' in config

Try / catch

try:
    info = ydl.extract_info(url)
except ExtractorError as e:
    if 'getting the playlist' in str(e):
        verify_media_id(url)
    else:
        raise

Prevention

When it happens

Trigger: Downloading a Wistia embed whose config JSON has embed_config['error'] set — bad hashed ID (not 10-char [a-z0-9]), deleted media, or a token-protected embed requiring the Referer header the request did not satisfy.

Common situations: Embedding sites changed their Wistia media IDs; the video was set private or removed from the Wistia project; hotlinking an embed whose config requires the original page as Referer.

Related errors


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