From 3d380b5fa5120f60d6cea5eb57a47f75c9399c1b Mon Sep 17 00:00:00 2001 From: arabcoders Date: Fri, 2 May 2025 21:16:58 +0300 Subject: [PATCH] Fix youtube --live-from-start for premieres --- yt_dlp/extractor/youtube/_video.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py index 5edf165601..32221042e2 100644 --- a/yt_dlp/extractor/youtube/_video.py +++ b/yt_dlp/extractor/youtube/_video.py @@ -1812,14 +1812,17 @@ class YoutubeIE(YoutubeBaseInfoExtractor): with lock: refetch_manifest(format_id, delay) - f = next((f for f in formats if f.get('format_id') == format_id and 'manifest_url' in f), None) + f = next((f for f in formats if f.get('format_id') == format_id), 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 + + if not isinstance(f, dict) or not f.get('manifest_url'): + break + return f.get('manifest_url'), f.get('manifest_stream_number'), is_live return None