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] [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 @@ def tokenize_url(url, token): # 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 @@ def tokenize_url(url, token): '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,