From f63a7e41d120ef84f0f2274b0962438e3272d2fa Mon Sep 17 00:00:00 2001 From: bashonly Date: Tue, 19 Aug 2025 21:22:00 -0500 Subject: [PATCH] [ie/youtube] Add `playback_wait` extractor-arg Authored by: bashonly --- README.md | 2 +- yt_dlp/extractor/youtube/_video.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 52107dabb0..56a53a08b4 100644 --- a/README.md +++ b/README.md @@ -1816,7 +1816,7 @@ The following extractors use this feature: * `po_token`: Proof of Origin (PO) Token(s) to use. Comma seperated list of PO Tokens in the format `CLIENT.CONTEXT+PO_TOKEN`, e.g. `youtube:po_token=web.gvs+XXX,web.player=XXX,web_safari.gvs+YYY`. Context can be any of `gvs` (Google Video Server URLs), `player` (Innertube player request) or `subs` (Subtitles) * `pot_trace`: Enable debug logging for PO Token fetching. Either `true` or `false` (default) * `fetch_pot`: Policy to use for fetching a PO Token from providers. One of `always` (always try fetch a PO Token regardless if the client requires one for the given context), `never` (never fetch a PO Token), or `auto` (default; only fetch a PO Token if the client requires one for the given context) -* `preroll_sleep`: Duration (in seconds) to wait inbetween the extraction and download stages in order to ensure the formats are available. The default is `6` seconds +* `playback_wait`: Duration (in seconds) to wait inbetween the extraction and download stages in order to ensure the formats are available. The default is `6` seconds #### youtubepot-webpo * `bind_to_visitor_id`: Whether to use the Visitor ID instead of Visitor Data for caching WebPO tokens. Either `true` (default) or `false` diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py index 71fde2a3fb..2bf6f01a90 100644 --- a/yt_dlp/extractor/youtube/_video.py +++ b/yt_dlp/extractor/youtube/_video.py @@ -4045,9 +4045,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor): self._prepare_live_from_start_formats( formats, video_id, live_start_time, url, webpage_url, smuggled_data, live_status == 'is_live') elif live_status != 'is_live': - # Handle preroll waiting period - preroll_sleep = int_or_none(self._configuration_arg('preroll_sleep', [None])[0], default=6) - available_at = int(time.time()) + preroll_sleep + # Handle pre-playback waiting period + playback_wait = int_or_none(self._configuration_arg('playback_wait', [None])[0], default=6) + available_at = int(time.time()) + playback_wait for fmt in formats: fmt['available_at'] = available_at