From b564e2894903c51a11f59a38a9de2ff443418c62 Mon Sep 17 00:00:00 2001 From: lukassup Date: Wed, 10 Jul 2024 23:25:23 +0300 Subject: [PATCH] [ie/tvplay] fix: support more video types --- yt_dlp/extractor/tvplay.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/yt_dlp/extractor/tvplay.py b/yt_dlp/extractor/tvplay.py index 72a5af2b31..4ecc1c613b 100644 --- a/yt_dlp/extractor/tvplay.py +++ b/yt_dlp/extractor/tvplay.py @@ -280,12 +280,10 @@ def _real_extract(self, url): data = self._download_json( urljoin(url, f'/api/products/{api_path}/{video_id}?platform=BROWSER&lang={country.upper()}'), video_id) - - video_type = { - 'live': 'LIVE', - 'programme': 'CATCHUP', - }.get(category) or 'MOVIE' - stream_id = data.get('programRecordingId') or video_id + video_type = 'MOVIE' + if category not in ('episode', 'clip'): + video_type = traverse_obj(data, ('mainCategory', 'categoryType')) or 'MOVIE' + stream_id = traverse_obj(data, ('live', 'id')) or data.get('programRecordingId') or video_id stream = self._download_json( urljoin(url, f'/api/products/{stream_id}/videos/playlist?videoType={video_type}&platform=BROWSER'), video_id) formats, subtitles = self._extract_m3u8_formats_and_subtitles(