[abc:iview] apply more suggestions

This commit is contained in:
ClosedPort22 2024-06-28 09:21:53 +08:00
parent ad98e612dc
commit d1789d4a8b
No known key found for this signature in database
1 changed files with 3 additions and 4 deletions

View File

@ -334,10 +334,9 @@ class ABCIViewIE(InfoExtractor):
# Note: pre-merged formats in hls-latest are treated as video-only if audio-only tracks # Note: pre-merged formats in hls-latest are treated as video-only if audio-only tracks
# are present, so we extract both types # are present, so we extract both types
for label in ('hls', 'hls-latest'): 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( fmts = self._extract_m3u8_formats(
tokenize_url(sd_url, token), video_id, 'mp4', tokenize_url(sd_url, token), video_id, 'mp4', m3u8_id=label, fatal=False)
entry_protocol='m3u8_native', m3u8_id=label, fatal=False)
if fmts: if fmts:
formats.extend(fmts) formats.extend(fmts)
break break
@ -349,7 +348,7 @@ class ABCIViewIE(InfoExtractor):
'ext': 'vtt', 'ext': 'vtt',
}] }]
title = unescapeHTML(traverse_obj(video_params, 'title', 'seriesTitle', 'showTitle')) title = traverse_obj(video_params, 'title', 'seriesTitle', 'showTitle', expected_type=unescapeHTML)
return { return {
'id': video_id, 'id': video_id,