{"record":{"id":"ef040baed840acd2","repo":"ytdl-org/youtube-dl","slug":"failed-to-get-video-url","errorCode":null,"errorMessage":"Failed to get video URL","messagePattern":"Failed to get video URL","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/sohu.py","lineNumber":171,"sourceCode":"\n                    if cdnId is not None:\n                        params['idc'] = cdnId\n\n                    download_note = 'Downloading %s video URL part %d of %d' % (\n                        format_id, i + 1, part_count)\n\n                    if retries > 0:\n                        download_note += ' (retry #%d)' % retries\n                    part_info = self._parse_json(self._download_webpage(\n                        'http://%s/?%s' % (allot, compat_urllib_parse_urlencode(params)),\n                        video_id, download_note), video_id)\n\n                    video_url = part_info['url']\n                    cdnId = part_info.get('nid')\n\n                    retries += 1\n                    if retries > 5:\n                        raise ExtractorError('Failed to get video URL')\n\n                formats.append({\n                    'url': video_url,\n                    'format_id': format_id,\n                    'filesize': int_or_none(\n                        try_get(data, lambda x: x['clipsBytes'][i])),\n                    'width': int_or_none(data.get('width')),\n                    'height': int_or_none(data.get('height')),\n                    'fps': int_or_none(data.get('fps')),\n                })\n            self._sort_formats(formats)\n\n            playlist.append({\n                'id': '%s_part%d' % (video_id, i + 1),\n                'title': title,\n                'duration': vid_data['data']['clipsDuration'][i],\n                'formats': formats,\n            })","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/sohu.py#L153-L189","documentation":"SohuIE's per-part URL resolution loop asks Sohu's CDN allot server for each clip's real URL and retries while part_info['url'] keeps failing the validity check. After more than 5 retries the loop raises 'Failed to get video URL' - notably WITHOUT expected=True, so youtube-dl treats it as an unexpected extraction failure. It means the CDN's URL-dispensing endpoint never returned a usable URL for a clip.","triggerScenarios":"Downloading a multi-part Sohu video where the request to http://<allot>/?<params> repeatedly returns JSON whose 'url' is empty or fails the re-check (e.g. 'clip is illegal' or invalid host). Each bad answer increments retries; exceeding 5 aborts the whole extraction.","commonSituations":"CDN nodes under load or returning junk for certain formats (try a different -f); geo-restricted clips whose allot answers are valid in CN only; rate limiting from hammering the allot endpoint; occasional transient CDN inconsistency for 4K (h2654k) streams.","solutions":["Retry later - transient allot-server flakiness is the most common cause.","Select a different quality format (-f nor/high/super/ori) since only some formats' clips may be broken.","Route through a mainland-China VPN if outside CN.","If persistent for a specific video, the asset's clips are corrupt server-side; report it or use another source."],"exampleFix":"// before\nif retries > 5:\n    raise ExtractorError('Failed to get video URL')\n\n// after (skip the broken part instead of failing the whole video)\nif retries > 5:\n    self.report_warning('Part %d of %s failed; skipping' % (i, format_id))\n    continue","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"for attempt in range(3):\n    try:\n        extract(url)\n        break\n    except ExtractorError as e:\n        if 'Failed to get video URL' == str(e) and attempt < 2:\n            sleep(backoff(attempt)); continue\n        raise","preventionTips":["Retry later with backoff - the allot endpoint is intermittently flaky.","Try alternate format ids (-f) since failures can be per-format.","Use CN egress if consistently failing from abroad."],"tags":["sohu","cdn","retry-exhausted","extractor","transient"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}