1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 00:25:08 +00:00

[cleanup] Misc (#10075)

Closes #10303
Authored by: bashonly, seproDev, jucor, c-basalt

Co-authored-by: sepro <4618135+seproDev@users.noreply.github.com>
Co-authored-by: Julien Cornebise <julien@cornebise.com>
Co-authored-by: c-basalt <117849907+c-basalt@users.noreply.github.com>
This commit is contained in:
bashonly
2024-07-01 17:51:27 -05:00
committed by GitHub
parent d4b99a2333
commit 6aaf96a3d6
42 changed files with 132 additions and 106 deletions

View File

@ -8,6 +8,7 @@ from ..utils import (
ExtractorError,
clean_html,
int_or_none,
join_nonempty,
mimetype2ext,
parse_iso8601,
traverse_obj,
@ -213,7 +214,7 @@ class YahooIE(InfoExtractor):
tbr = int_or_none(s.get('bitrate'))
formats.append({
'url': s_url,
'format_id': fmt + (f'-{tbr}' if tbr else ''),
'format_id': join_nonempty(fmt, tbr),
'width': int_or_none(s.get('width')),
'height': int_or_none(s.get('height')),
'tbr': tbr,
@ -371,12 +372,13 @@ class YahooJapanNewsIE(InfoExtractor):
url, content_id, 'mp4', 'm3u8_native',
m3u8_id='hls', fatal=False))
else:
bitrate = int_or_none(vid.get('bitrate'))
formats.append({
'url': url,
'format_id': f'http-{vid.get("bitrate")}',
'format_id': join_nonempty('http', bitrate),
'height': int_or_none(vid.get('height')),
'width': int_or_none(vid.get('width')),
'tbr': int_or_none(vid.get('bitrate')),
'tbr': bitrate,
})
self._remove_duplicate_formats(formats)