From 51175fe3b4a5eae59860eb39f8bf6b5a22c46727 Mon Sep 17 00:00:00 2001 From: sepro Date: Wed, 24 Sep 2025 11:06:37 +0200 Subject: [PATCH] Don't attempt upgrade if 1080p is provided --- yt_dlp/extractor/tenplay.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/tenplay.py b/yt_dlp/extractor/tenplay.py index 9a6d76273d..8bca35ee8d 100644 --- a/yt_dlp/extractor/tenplay.py +++ b/yt_dlp/extractor/tenplay.py @@ -224,18 +224,21 @@ class TenPlayIE(InfoExtractor): formats, _ = self._extract_m3u8_formats_and_subtitles( dai_data['stream_manifest'], content_id, 'mp4') + already_have_1080p = False for fmt in formats: m3u8_doc = self._download_webpage( fmt['url'], content_id, note='Downloading m3u8 information') m3u8_doc = self._filter_ads_from_m3u8(m3u8_doc) fmt['hls_media_playlist_data'] = m3u8_doc + if fmt.get('height') == 1080: + already_have_1080p = True # Attempt format upgrade - if m3u8_doc and re.search(r'(?m)-(?:300|150|75|55)0000-\d+\.ts$', m3u8_doc): + if not already_have_1080p and m3u8_doc and re.search(r'(?m)-(?:300|150|75|55)0000-\d+\.ts$', m3u8_doc): m3u8_doc = re.sub(r'(?m)-(?:300|150|75|55)0000-(\d+)\.ts$', r'-5000000-\1.ts', m3u8_doc) m3u8_doc = re.sub(r'-(?:300|150|75|55)0000\.key"', r'-5000000.key"', m3u8_doc) formats.append({ - 'format_id': 'hls-1080p', + 'format_id': 'upgrade-attempt-1080p', 'url': formats[0]['url'], 'hls_media_playlist_data': m3u8_doc, 'width': 1920,