{"record":{"id":"5aaf21f8547d5fec","repo":"ytdl-org/youtube-dl","slug":"an-unknown-error-occurred-0","errorCode":null,"errorMessage":"An unknown error occurred ({0}).","messagePattern":"An unknown error occurred \\((.+?)\\)\\.","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/medaltv.py","lineNumber":110,"sourceCode":"            if not mobj:\n                continue\n            prefix = mobj.group(1)\n            height = int_or_none(mobj.group(2))\n            if prefix == 'contentUrl':\n                add_item(\n                    formats, v, height or source_height,\n                    item_id=None if height else 'source')\n            elif prefix == 'thumbnail':\n                add_item(thumbnails, v, height, 'id')\n\n        error = clip.get('error')\n        if not formats and error:\n            if error == 404:\n                raise ExtractorError(\n                    'That clip does not exist.',\n                    expected=True, video_id=video_id)\n            else:\n                raise ExtractorError(\n                    'An unknown error occurred ({0}).'.format(error),\n                    video_id=video_id)\n\n        self._sort_formats(formats)\n\n        # Necessary because the id of the author is not known in advance.\n        # Won't raise an issue if no profile can be found as this is optional.\n        author = try_get(\n            hydration_data, lambda x: list(x['profiles'].values())[0], dict) or {}\n        author_id = str_or_none(author.get('id'))\n        author_url = 'https://medal.tv/users/{0}'.format(author_id) if author_id else None\n\n        return {\n            'id': video_id,\n            'title': title,\n            'formats': formats,\n            'thumbnails': thumbnails,\n            'description': clip.get('contentDescription'),","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/medaltv.py#L92-L128","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Retry once after a short delay to rule out a transient server-side error.","Check the clip in a browser while logged in; permission-related codes mean you lack access.","Run with -v and note the numeric code, then report unmapped codes to the youtube-dl issue tracker."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":"def medal_clip_unknown_error(clip):\n    return isinstance(clip, dict) and clip.get('error') not in (None, 404)","tryCatchPattern":"try:\n    info = ydl.extract_info(url, download=False)\nexcept ExtractorError as e:\n    if 'unknown error occurred' in str(e):\n        schedule_retry(url, backoff=60)  # may be transient; retry once before flagging\n    else:\n        raise","preventionTips":["Retry once with backoff — unmapped codes are sometimes transient server faults.","Log the numeric code so permission (4xx) vs server (5xx) codes get different handling."],"tags":["api-error","unknown-code","clip"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}