From b2e6bb0dd4ebbe7962389ba911455496d44f36c5 Mon Sep 17 00:00:00 2001 From: bashonly <88596187+bashonly@users.noreply.github.com> Date: Mon, 23 Nov 2026 16:12:47 +0000 Subject: [PATCH] [ie/youtube] Apply temporary STS workaround (#18126) Authored by: bashonly --- yt_dlp/extractor/youtube/_video.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/youtube/_video.py b/yt_dlp/extractor/youtube/_video.py index b58cb2dc64..fba53c7380 100644 --- a/yt_dlp/extractor/youtube/_video.py +++ b/yt_dlp/extractor/youtube/_video.py @@ -2242,7 +2242,12 @@ class YoutubeIE(YoutubeBaseInfoExtractor): sts = traverse_obj(ytcfg, ('STS', {int_or_none})) if sts: - return sts + # TODO: Revert to `return sts` immediately when reworking STS/variant handling! + # XXX: If any supported (i.e. non-`tcl`) variants start using >5 digit STS, + # then the line of code below is dead wrong and actively harmful! + # XXX: If clients other than tv_downgraded start seeing "the page needs to be reloaded" + # errors, this STS truncation is the likely culprit! Revert it! + return int(str(sts)[:5]) if not player_url: error_msg = 'Cannot extract signature timestamp without player url'