From 81f217b55254767068a1a893da9b22319625c8cb Mon Sep 17 00:00:00 2001 From: ClosedPort22 <44864697+ClosedPort22@users.noreply.github.com> Date: Mon, 10 Jun 2024 10:36:45 +0800 Subject: [PATCH 01/10] [abc:iview] use V3 API if possible --- yt_dlp/extractor/abc.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/yt_dlp/extractor/abc.py b/yt_dlp/extractor/abc.py index 2c0d296fd2..a38593b9a4 100644 --- a/yt_dlp/extractor/abc.py +++ b/yt_dlp/extractor/abc.py @@ -283,11 +283,19 @@ class ABCIViewIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) video_params = self._download_json( - 'https://iview.abc.net.au/api/programs/' + video_id, video_id) + 'https://api.iview.abc.net.au/v3/video/' + video_id, video_id, + errnote='Failed to download API V3 JSON', fatal=False) + # fallback to legacy API, which will return some useful info even if the video is unavailable + if not video_params: + video_params = self._download_json( + 'https://iview.abc.net.au/api/programs/' + video_id, video_id, + note='Downloading legacy API JSON') title = unescapeHTML(video_params.get('title') or video_params['seriesTitle']) - stream = next(s for s in video_params['playlist'] if s.get('type') in ('program', 'livestream')) + stream = traverse_obj(video_params, ( + ('_embedded', None), 'playlist', lambda _, v: v['type'] in ('program', 'livestream')), + get_all=False) - house_number = video_params.get('episodeHouseNumber') or video_id + house_number = traverse_obj(video_params, ('houseNumber', 'episodeHouseNumber')) or video_id path = '/auth/hls/sign?ts={0}&hn={1}&d=android-tablet'.format( int(time.time()), house_number) sig = hmac.new( @@ -320,17 +328,23 @@ class ABCIViewIE(InfoExtractor): 'ext': 'vtt', }] - is_live = video_params.get('livestream') == '1' + is_live = video_params.get('livestream') == '1' or stream['type'] == 'livestream' + thumbnail = traverse_obj( + video_params, + ('images', lambda _, v: v['name'] == 'episodeThumbnail', 'url'), + 'thumbnail', expected_type=str, get_all=False) + series_id = traverse_obj( + video_params, ('analytics', 'oztam', 'seriesId'), 'seriesHouseNumber') or video_id[:7] return { 'id': video_id, 'title': title, 'description': video_params.get('description'), - 'thumbnail': video_params.get('thumbnail'), - 'duration': int_or_none(video_params.get('eventDuration')), + 'thumbnail': thumbnail, + 'duration': int_or_none(traverse_obj(video_params, 'duration', 'eventDuration')), 'timestamp': parse_iso8601(video_params.get('pubDate'), ' '), 'series': unescapeHTML(video_params.get('seriesTitle')), - 'series_id': video_params.get('seriesHouseNumber') or video_id[:7], + 'series_id': series_id, 'season_number': int_or_none(self._search_regex( r'\bSeries\s+(\d+)\b', title, 'season number', default=None)), 'episode_number': int_or_none(self._search_regex( From 37ab29ad700461ffa5488c39fa7d3bfd8f388d57 Mon Sep 17 00:00:00 2001 From: ClosedPort22 <44864697+ClosedPort22@users.noreply.github.com> Date: Mon, 10 Jun 2024 10:51:06 +0800 Subject: [PATCH 02/10] [abc:iview] extract chapters --- yt_dlp/extractor/abc.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/yt_dlp/extractor/abc.py b/yt_dlp/extractor/abc.py index a38593b9a4..9438826eee 100644 --- a/yt_dlp/extractor/abc.py +++ b/yt_dlp/extractor/abc.py @@ -198,6 +198,19 @@ class ABCIViewIE(InfoExtractor): 'season': 'Season 1', 'episode_number': 1, 'episode': 'Wood For The Trees', + 'duration': 1584, + 'chapters': [ + { + 'start_time': 0, + 'end_time': 1, + 'title': '', + }, + { + 'start_time': 1, + 'end_time': 24, + 'title': 'opening-credits', + }, + ], 'thumbnail': 'https://cdn.iview.abc.net.au/thumbs/i/co/CO1211V001S00_5ad8353f4df09_1280.jpg', 'timestamp': 1690403700, }, @@ -335,12 +348,15 @@ class ABCIViewIE(InfoExtractor): 'thumbnail', expected_type=str, get_all=False) series_id = traverse_obj( video_params, ('analytics', 'oztam', 'seriesId'), 'seriesHouseNumber') or video_id[:7] + chapters = traverse_obj( + video_params, ('cuePoints', ..., {'start_time': 'start', 'end_time': 'end', 'title': 'type'})) return { 'id': video_id, 'title': title, 'description': video_params.get('description'), 'thumbnail': thumbnail, + 'chapters': chapters, 'duration': int_or_none(traverse_obj(video_params, 'duration', 'eventDuration')), 'timestamp': parse_iso8601(video_params.get('pubDate'), ' '), 'series': unescapeHTML(video_params.get('seriesTitle')), From 5c3a2daf6af3d922be4ca805f618b5a79ed02fe1 Mon Sep 17 00:00:00 2001 From: ClosedPort22 <44864697+ClosedPort22@users.noreply.github.com> Date: Thu, 27 Jun 2024 11:30:04 +0800 Subject: [PATCH 03/10] [abc:iview] fix series name extraction --- yt_dlp/extractor/abc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/abc.py b/yt_dlp/extractor/abc.py index 3fae0a87fe..e3ed788d5e 100644 --- a/yt_dlp/extractor/abc.py +++ b/yt_dlp/extractor/abc.py @@ -302,7 +302,6 @@ class ABCIViewIE(InfoExtractor): video_params = self._download_json( 'https://iview.abc.net.au/api/programs/' + video_id, video_id, note='Downloading legacy API JSON') - title = unescapeHTML(video_params.get('title') or video_params['seriesTitle']) stream = traverse_obj(video_params, ( ('_embedded', None), 'playlist', lambda _, v: v['type'] in ('program', 'livestream')), get_all=False) @@ -349,6 +348,8 @@ class ABCIViewIE(InfoExtractor): chapters = traverse_obj( video_params, ('cuePoints', ..., {'start_time': 'start', 'end_time': 'end', 'title': 'type'})) + title = unescapeHTML(traverse_obj(video_params, 'title', 'seriesTitle', 'showTitle')) + return { 'id': video_id, 'title': title, @@ -357,7 +358,7 @@ class ABCIViewIE(InfoExtractor): 'chapters': chapters, 'duration': int_or_none(traverse_obj(video_params, 'duration', 'eventDuration')), 'timestamp': parse_iso8601(video_params.get('pubDate'), ' '), - 'series': unescapeHTML(video_params.get('seriesTitle')), + 'series': unescapeHTML(traverse_obj(video_params, 'seriesTitle', 'showTitle')), 'series_id': series_id, 'season_number': int_or_none(self._search_regex( r'\bSeries\s+(\d+)\b', title, 'season number', default=None)), From c96f9aba0d2694783676dfb97b837d2ff6995766 Mon Sep 17 00:00:00 2001 From: ClosedPort22 <44864697+ClosedPort22@users.noreply.github.com> Date: Thu, 27 Jun 2024 12:54:22 +0800 Subject: [PATCH 04/10] [abc:iview] extract audio description track 'hls' -> 'hls-latest' --- yt_dlp/extractor/abc.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/yt_dlp/extractor/abc.py b/yt_dlp/extractor/abc.py index e3ed788d5e..b527050fcd 100644 --- a/yt_dlp/extractor/abc.py +++ b/yt_dlp/extractor/abc.py @@ -319,9 +319,7 @@ class ABCIViewIE(InfoExtractor): 'hdnea': token, }) - for sd in ('1080', '720', 'sd', 'sd-low'): - sd_url = try_get( - stream, lambda x: x['streams']['hls'][sd], str) + for sd_url in traverse_obj(stream, ('streams', 'hls-latest', ('1080', '720', 'sd', 'sd-low'), {str})): if not sd_url: continue formats = self._extract_m3u8_formats( From 9bdc35032dd9d3dcf8117daac143b8dac461e584 Mon Sep 17 00:00:00 2001 From: ClosedPort22 <44864697+ClosedPort22@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:05:22 +0800 Subject: [PATCH 05/10] [abc:iview] fix episode number parsing and tests --- yt_dlp/extractor/abc.py | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/yt_dlp/extractor/abc.py b/yt_dlp/extractor/abc.py index b527050fcd..7da8bded55 100644 --- a/yt_dlp/extractor/abc.py +++ b/yt_dlp/extractor/abc.py @@ -186,7 +186,7 @@ class ABCIViewIE(InfoExtractor): 'info_dict': { 'id': 'CO1211V001S00', 'ext': 'mp4', - 'title': 'Series 1 Ep 1 Wood For The Trees', + 'title': 'Series 1 Episode 1 Wood For The Trees', 'series': 'Utopia', 'description': 'md5:0cfb2c183c1b952d1548fd65c8a95c00', 'upload_date': '20230726', @@ -209,6 +209,11 @@ class ABCIViewIE(InfoExtractor): 'end_time': 24, 'title': 'opening-credits', }, + { + 'start_time': 1564, + 'end_time': 1584, + 'title': 'end-credits', + }, ], 'thumbnail': 'https://cdn.iview.abc.net.au/thumbs/i/co/CO1211V001S00_5ad8353f4df09_1280.jpg', 'timestamp': 1690403700, @@ -218,24 +223,26 @@ class ABCIViewIE(InfoExtractor): }, }, { 'note': 'No episode name', - 'url': 'https://iview.abc.net.au/show/gruen/series/11/video/LE1927H001S00', + 'url': 'https://iview.abc.net.au/show/gruen/series/15/video/LE2327H001S00', 'md5': '67715ce3c78426b11ba167d875ac6abf', 'info_dict': { - 'id': 'LE1927H001S00', + 'id': 'LE2327H001S00', 'ext': 'mp4', - 'title': 'Series 11 Ep 1', + 'title': 'Series 15 Episode 1', 'series': 'Gruen', - 'description': 'md5:52cc744ad35045baf6aded2ce7287f67', - 'upload_date': '20190925', + 'description': 'md5:ac3bf529d467d8436954db1e90d2f06d', + 'upload_date': '20230621', 'uploader_id': 'abc1', - 'series_id': 'LE1927H', - 'episode_id': 'LE1927H001S00', - 'season_number': 11, - 'season': 'Season 11', + 'series_id': 'LE2327H', + 'episode_id': 'LE2327H001S00', + 'season_number': 15, + 'season': 'Season 15', 'episode_number': 1, 'episode': 'Episode 1', - 'thumbnail': 'https://cdn.iview.abc.net.au/thumbs/i/le/LE1927H001S00_5d954fbd79e25_1280.jpg', - 'timestamp': 1569445289, + 'thumbnail': 'https://cdn.iview.abc.net.au/thumbs/i/le/LE2327H001S00_649279152faea_3600.jpg', + 'timestamp': 1687379421, + 'duration': 2117, + 'chapters': 'count:2', }, 'expected_warnings': ['Ignoring subtitle tracks found in the HLS manifest'], 'params': { @@ -260,7 +267,8 @@ class ABCIViewIE(InfoExtractor): 'episode': 'Locking Up Kids', 'thumbnail': 'https://cdn.iview.abc.net.au/thumbs/i/nc/NC2203H039S00_636d8a0944a22_1920.jpg', 'timestamp': 1668460497, - + 'duration': 2802, + 'chapters': 'count:2', }, 'expected_warnings': ['Ignoring subtitle tracks found in the HLS manifest'], 'params': { @@ -284,7 +292,8 @@ class ABCIViewIE(InfoExtractor): 'season': 'Season 2021', 'thumbnail': 'https://cdn.iview.abc.net.au/thumbs/i/rf/RF2004Q043S00_61a950639dbc0_1920.jpg', 'timestamp': 1638710705, - + 'duration': 3381, + 'chapters': 'count:2', }, 'expected_warnings': ['Ignoring subtitle tracks found in the HLS manifest'], 'params': { @@ -361,10 +370,10 @@ class ABCIViewIE(InfoExtractor): 'season_number': int_or_none(self._search_regex( r'\bSeries\s+(\d+)\b', title, 'season number', default=None)), 'episode_number': int_or_none(self._search_regex( - r'\bEp\s+(\d+)\b', title, 'episode number', default=None)), + r'\bEp(?:isode)?\s+(\d+)\b', title, 'episode number', default=None)), 'episode_id': house_number, 'episode': self._search_regex( - r'^(?:Series\s+\d+)?\s*(?:Ep\s+\d+)?\s*(.*)$', title, 'episode', default='') or None, + r'^(?:Series\s+\d+)?\s*(?:Ep(?:isode)?\s+\d+)?\s*(.*)$', title, 'episode', default='') or None, 'uploader_id': video_params.get('channel'), 'formats': formats, 'subtitles': subtitles, From fcc727b755ad02e760163cf4369d5a40dc073b32 Mon Sep 17 00:00:00 2001 From: ClosedPort22 <44864697+ClosedPort22@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:07:53 +0800 Subject: [PATCH 06/10] [abc:iview] simplify --- yt_dlp/extractor/abc.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/yt_dlp/extractor/abc.py b/yt_dlp/extractor/abc.py index 7da8bded55..96d92abd50 100644 --- a/yt_dlp/extractor/abc.py +++ b/yt_dlp/extractor/abc.py @@ -1,3 +1,4 @@ +import functools import hashlib import hmac import re @@ -338,35 +339,21 @@ class ABCIViewIE(InfoExtractor): break subtitles = {} - src_vtt = stream.get('captions', {}).get('src-vtt') + src_vtt = traverse_obj(stream, ('captions', 'src-vtt')) if src_vtt: subtitles['en'] = [{ 'url': src_vtt, 'ext': 'vtt', }] - is_live = video_params.get('livestream') == '1' or stream['type'] == 'livestream' - thumbnail = traverse_obj( - video_params, - ('images', lambda _, v: v['name'] == 'episodeThumbnail', 'url'), - 'thumbnail', expected_type=str, get_all=False) - series_id = traverse_obj( - video_params, ('analytics', 'oztam', 'seriesId'), 'seriesHouseNumber') or video_id[:7] - chapters = traverse_obj( - video_params, ('cuePoints', ..., {'start_time': 'start', 'end_time': 'end', 'title': 'type'})) - title = unescapeHTML(traverse_obj(video_params, 'title', 'seriesTitle', 'showTitle')) return { 'id': video_id, 'title': title, - 'description': video_params.get('description'), - 'thumbnail': thumbnail, - 'chapters': chapters, - 'duration': int_or_none(traverse_obj(video_params, 'duration', 'eventDuration')), - 'timestamp': parse_iso8601(video_params.get('pubDate'), ' '), - 'series': unescapeHTML(traverse_obj(video_params, 'seriesTitle', 'showTitle')), - 'series_id': series_id, + 'series_id': traverse_obj( + video_params, + ('analytics', 'oztam', 'seriesId'), 'seriesHouseNumber') or video_id[:7], 'season_number': int_or_none(self._search_regex( r'\bSeries\s+(\d+)\b', title, 'season number', default=None)), 'episode_number': int_or_none(self._search_regex( @@ -374,10 +361,23 @@ class ABCIViewIE(InfoExtractor): 'episode_id': house_number, 'episode': self._search_regex( r'^(?:Series\s+\d+)?\s*(?:Ep(?:isode)?\s+\d+)?\s*(.*)$', title, 'episode', default='') or None, - 'uploader_id': video_params.get('channel'), + 'is_live': video_params.get('livestream') == '1' or stream['type'] == 'livestream', 'formats': formats, 'subtitles': subtitles, - 'is_live': is_live, + **traverse_obj(video_params, { + 'description': ('description', {str}), + 'thumbnail': (( + ('images', lambda _, v: v['name'] == 'episodeThumbnail', 'url'), 'thumbnail'), {str}, any), + 'chapters': ('cuePoints', ..., { + 'start_time': ('start', {int_or_none}), + 'end_time': ('end', {int_or_none}), + 'title': ('type', {str}), + }), + 'duration': (('duration', 'eventDuration'), {int_or_none}, any), + 'timestamp': ('pubDate', {functools.partial(parse_iso8601, delimiter=' ')}), + 'series': (('seriesTitle', 'showTitle'), {unescapeHTML}, any), + 'uploader_id': ('channel', {str}), + }), } From 16ed8814be8c805b08f82917d9ffa95d2df607c5 Mon Sep 17 00:00:00 2001 From: ClosedPort22 <44864697+ClosedPort22@users.noreply.github.com> Date: Thu, 27 Jun 2024 21:53:15 +0800 Subject: [PATCH 07/10] [abc:iview] extract from both 'hls' and 'hls-latest' This ensures backward compatibility by also providing the pre-merged formats --- yt_dlp/extractor/abc.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/yt_dlp/extractor/abc.py b/yt_dlp/extractor/abc.py index 96d92abd50..b9bf8c0a55 100644 --- a/yt_dlp/extractor/abc.py +++ b/yt_dlp/extractor/abc.py @@ -329,14 +329,19 @@ class ABCIViewIE(InfoExtractor): 'hdnea': token, }) - for sd_url in traverse_obj(stream, ('streams', 'hls-latest', ('1080', '720', 'sd', 'sd-low'), {str})): - if not sd_url: - continue - formats = self._extract_m3u8_formats( - tokenize_url(sd_url, token), video_id, 'mp4', - entry_protocol='m3u8_native', m3u8_id='hls', fatal=False) - if formats: - break + formats = [] + # hls: pre-merged formats + # hls-latest: same as hls, but sometimes has separate audio tracks + # Note: pre-merged formats in hls-latest are treated as video-only if audio-only tracks + # are present, so we extract both types + for label in ('hls', 'hls-latest'): + for sd_url in traverse_obj(stream, ('streams', label, ('1080', '720', 'sd', 'sd-low'), {str})): + fmts = self._extract_m3u8_formats( + tokenize_url(sd_url, token), video_id, 'mp4', + entry_protocol='m3u8_native', m3u8_id=label, fatal=False) + if fmts: + formats.extend(fmts) + break subtitles = {} src_vtt = traverse_obj(stream, ('captions', 'src-vtt')) From ad98e612dc28bd94e4ab647c37719258a23ad5a1 Mon Sep 17 00:00:00 2001 From: ClosedPort22 <44864697+ClosedPort22@users.noreply.github.com> Date: Fri, 28 Jun 2024 01:15:49 +0000 Subject: [PATCH 08/10] [abc:iview] Apply suggestions from code review Co-authored-by: bashonly <88596187+bashonly@users.noreply.github.com> --- yt_dlp/extractor/abc.py | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/yt_dlp/extractor/abc.py b/yt_dlp/extractor/abc.py index b9bf8c0a55..4b574d7320 100644 --- a/yt_dlp/extractor/abc.py +++ b/yt_dlp/extractor/abc.py @@ -305,18 +305,17 @@ class ABCIViewIE(InfoExtractor): def _real_extract(self, url): video_id = self._match_id(url) video_params = self._download_json( - 'https://api.iview.abc.net.au/v3/video/' + video_id, video_id, + f'https://api.iview.abc.net.au/v3/video/{video_id}', video_id, errnote='Failed to download API V3 JSON', fatal=False) # fallback to legacy API, which will return some useful info even if the video is unavailable if not video_params: video_params = self._download_json( - 'https://iview.abc.net.au/api/programs/' + video_id, video_id, - note='Downloading legacy API JSON') + f'https://iview.abc.net.au/api/programs/{video_id}', video_id, + note='Falling back to legacy API JSON') stream = traverse_obj(video_params, ( - ('_embedded', None), 'playlist', lambda _, v: v['type'] in ('program', 'livestream')), - get_all=False) + ('_embedded', None), 'playlist', lambda _, v: v['type'] in ('program', 'livestream'), any)) or {} - house_number = traverse_obj(video_params, ('houseNumber', 'episodeHouseNumber')) or video_id + house_number = traverse_obj(video_params, 'houseNumber', 'episodeHouseNumber') or video_id path = f'/auth/hls/sign?ts={int(time.time())}&hn={house_number}&d=android-tablet' sig = hmac.new( b'android.content.res.Resources', @@ -344,8 +343,7 @@ class ABCIViewIE(InfoExtractor): break subtitles = {} - src_vtt = traverse_obj(stream, ('captions', 'src-vtt')) - if src_vtt: + if src_vtt := traverse_obj(stream, ('captions', 'src-vtt', {url_or_none})): subtitles['en'] = [{ 'url': src_vtt, 'ext': 'vtt', @@ -357,8 +355,7 @@ class ABCIViewIE(InfoExtractor): 'id': video_id, 'title': title, 'series_id': traverse_obj( - video_params, - ('analytics', 'oztam', 'seriesId'), 'seriesHouseNumber') or video_id[:7], + video_params, ('analytics', 'oztam', 'seriesId'), 'seriesHouseNumber') or video_id[:7], 'season_number': int_or_none(self._search_regex( r'\bSeries\s+(\d+)\b', title, 'season number', default=None)), 'episode_number': int_or_none(self._search_regex( @@ -366,14 +363,14 @@ class ABCIViewIE(InfoExtractor): 'episode_id': house_number, 'episode': self._search_regex( r'^(?:Series\s+\d+)?\s*(?:Ep(?:isode)?\s+\d+)?\s*(.*)$', title, 'episode', default='') or None, - 'is_live': video_params.get('livestream') == '1' or stream['type'] == 'livestream', + 'is_live': video_params.get('livestream') == '1' or stream.get('type') == 'livestream', 'formats': formats, 'subtitles': subtitles, **traverse_obj(video_params, { 'description': ('description', {str}), 'thumbnail': (( - ('images', lambda _, v: v['name'] == 'episodeThumbnail', 'url'), 'thumbnail'), {str}, any), - 'chapters': ('cuePoints', ..., { + ('images', lambda _, v: v['name'] == 'episodeThumbnail', 'url'), 'thumbnail'), {url_or_none}, any), + 'chapters': ('cuePoints', lambda _, v: int(v['start']) is not None, { 'start_time': ('start', {int_or_none}), 'end_time': ('end', {int_or_none}), 'title': ('type', {str}), From d1789d4a8bc33f5a3dbd59f9c8d83ed41e3124ea Mon Sep 17 00:00:00 2001 From: ClosedPort22 <44864697+ClosedPort22@users.noreply.github.com> Date: Fri, 28 Jun 2024 09:21:53 +0800 Subject: [PATCH 09/10] [abc:iview] apply more suggestions --- yt_dlp/extractor/abc.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/yt_dlp/extractor/abc.py b/yt_dlp/extractor/abc.py index 4b574d7320..65b7d60106 100644 --- a/yt_dlp/extractor/abc.py +++ b/yt_dlp/extractor/abc.py @@ -334,10 +334,9 @@ class ABCIViewIE(InfoExtractor): # Note: pre-merged formats in hls-latest are treated as video-only if audio-only tracks # are present, so we extract both types for label in ('hls', 'hls-latest'): - for sd_url in traverse_obj(stream, ('streams', label, ('1080', '720', 'sd', 'sd-low'), {str})): + for sd_url in traverse_obj(stream, ('streams', label, ('1080', '720', 'sd', 'sd-low'), {url_or_none})): fmts = self._extract_m3u8_formats( - tokenize_url(sd_url, token), video_id, 'mp4', - entry_protocol='m3u8_native', m3u8_id=label, fatal=False) + tokenize_url(sd_url, token), video_id, 'mp4', m3u8_id=label, fatal=False) if fmts: formats.extend(fmts) break @@ -349,7 +348,7 @@ class ABCIViewIE(InfoExtractor): 'ext': 'vtt', }] - title = unescapeHTML(traverse_obj(video_params, 'title', 'seriesTitle', 'showTitle')) + title = traverse_obj(video_params, 'title', 'seriesTitle', 'showTitle', expected_type=unescapeHTML) return { 'id': video_id, From 8314fc299dfb297e95649caac62db015ded8f7f8 Mon Sep 17 00:00:00 2001 From: ClosedPort22 <44864697+ClosedPort22@users.noreply.github.com> Date: Fri, 28 Jun 2024 09:35:44 +0800 Subject: [PATCH 10/10] [abc:iview] deprioritize audio description tracks --- yt_dlp/extractor/abc.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yt_dlp/extractor/abc.py b/yt_dlp/extractor/abc.py index 65b7d60106..6e4bf17967 100644 --- a/yt_dlp/extractor/abc.py +++ b/yt_dlp/extractor/abc.py @@ -341,6 +341,11 @@ class ABCIViewIE(InfoExtractor): formats.extend(fmts) break + # deprioritize audio description tracks + for f in formats: + if 'description' in (f.get('format_note') or '').lower(): + f['language_preference'] = -10 + subtitles = {} if src_vtt := traverse_obj(stream, ('captions', 'src-vtt', {url_or_none})): subtitles['en'] = [{