diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py index b3340e8f58..5edf165601 100644 --- a/yt_dlp/extractor/youtube/_video.py +++ b/yt_dlp/extractor/youtube/_video.py @@ -1812,14 +1812,15 @@ class YoutubeIE(YoutubeBaseInfoExtractor): with lock: refetch_manifest(format_id, delay) - f = next((f for f in formats if f['format_id'] == format_id), None) + f = next((f for f in formats if f.get('format_id') == format_id and 'manifest_url' in f), None) if not f: + # still no manifest_url → retry if not is_live: retry.error = f'{video_id}: Video is no longer live' else: retry.error = f'Cannot find refreshed manifest for format {format_id}{bug_reports_message()}' continue - return f['manifest_url'], f['manifest_stream_number'], is_live + return f.get('manifest_url'), f.get('manifest_stream_number'), is_live return None for f in formats: