ytdl-org/youtube-dl · error · ExtractorError

An unknown error occurred ({0}).

Error message

An unknown error occurred ({0}).

What it means

Raised by the Medal.tv extractor when no formats were extracted and the clip's 'error' field holds a value other than 404. The unknown numeric code is echoed back to the user. Unlike the 404 branch this error is NOT expected=True, so youtube-dl flags it as possibly an extractor defect.

Source

Thrown at youtube_dl/extractor/medaltv.py:110

            if not mobj:
                continue
            prefix = mobj.group(1)
            height = int_or_none(mobj.group(2))
            if prefix == 'contentUrl':
                add_item(
                    formats, v, height or source_height,
                    item_id=None if height else 'source')
            elif prefix == 'thumbnail':
                add_item(thumbnails, v, height, 'id')

        error = clip.get('error')
        if not formats and error:
            if error == 404:
                raise ExtractorError(
                    'That clip does not exist.',
                    expected=True, video_id=video_id)
            else:
                raise ExtractorError(
                    'An unknown error occurred ({0}).'.format(error),
                    video_id=video_id)

        self._sort_formats(formats)

        # Necessary because the id of the author is not known in advance.
        # Won't raise an issue if no profile can be found as this is optional.
        author = try_get(
            hydration_data, lambda x: list(x['profiles'].values())[0], dict) or {}
        author_id = str_or_none(author.get('id'))
        author_url = 'https://medal.tv/users/{0}'.format(author_id) if author_id else None

        return {
            'id': video_id,
            'title': title,
            'formats': formats,
            'thumbnails': thumbnails,
            'description': clip.get('contentDescription'),

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Retry once after a short delay to rule out a transient server-side error.
  2. Check the clip in a browser while logged in; permission-related codes mean you lack access.
  3. Run with -v and note the numeric code, then report unmapped codes to the youtube-dl issue tracker.
Defensive patterns

Strategy: retry

Type guard

def medal_clip_unknown_error(clip):
    return isinstance(clip, dict) and clip.get('error') not in (None, 404)

Try / catch

try:
    info = ydl.extract_info(url, download=False)
except ExtractorError as e:
    if 'unknown error occurred' in str(e):
        schedule_retry(url, backoff=60)  # may be transient; retry once before flagging
    else:
        raise

Prevention

When it happens

Trigger: clip.get('error') returns a truthy value different from 404 (e.g. 403 for private clips, 500 for server faults) while the formats list is empty.

Common situations: Clip set to friends-only/private (permission-style code); transient Medal API failure during hydration; new error codes introduced by Medal that the extractor has not mapped to specific messages.

Related errors


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