mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 10:31:29 +00:00
[ie/youtube] Fix format_note
(Bugfix for 3a3bd00037
) (#11028)
Authored by: bashonly
This commit is contained in:
parent
3ad0b7f422
commit
fa2be9a7c6
|
@ -4110,7 +4110,7 @@ def build_fragments(f):
|
|||
self.report_warning(
|
||||
f'{video_id}: Some formats are possibly damaged. They will be deprioritized', only_once=True)
|
||||
|
||||
client_name = fmt.get(STREAMING_DATA_CLIENT_NAME)
|
||||
client_name = fmt[STREAMING_DATA_CLIENT_NAME]
|
||||
po_token = fmt.get(STREAMING_DATA_PO_TOKEN)
|
||||
|
||||
if po_token:
|
||||
|
@ -4135,7 +4135,7 @@ def build_fragments(f):
|
|||
try_get(fmt, lambda x: x['projectionType'].replace('RECTANGULAR', '').lower()),
|
||||
try_get(fmt, lambda x: x['spatialAudioType'].replace('SPATIAL_AUDIO_TYPE_', '').lower()),
|
||||
is_damaged and 'DAMAGED', is_broken and 'BROKEN',
|
||||
(self.get_param('verbose') or all_formats) and client_name,
|
||||
(self.get_param('verbose') or all_formats) and short_client_name(client_name),
|
||||
delim=', '),
|
||||
# Format 22 is likely to be damaged. See https://github.com/yt-dlp/yt-dlp/issues/3372
|
||||
'source_preference': (-5 if itag == '22' else -1) + (100 if 'Premium' in name else 0),
|
||||
|
@ -4234,7 +4234,8 @@ def process_manifest_format(f, proto, client_name, itag, po_token):
|
|||
if f['quality'] == -1 and f.get('height'):
|
||||
f['quality'] = q(res_qualities[min(res_qualities, key=lambda x: abs(x - f['height']))])
|
||||
if self.get_param('verbose') or all_formats:
|
||||
f['format_note'] = join_nonempty(f.get('format_note'), client_name, delim=', ')
|
||||
f['format_note'] = join_nonempty(
|
||||
f.get('format_note'), short_client_name(client_name), delim=', ')
|
||||
if f.get('fps') and f['fps'] <= 1:
|
||||
del f['fps']
|
||||
|
||||
|
@ -4245,7 +4246,7 @@ def process_manifest_format(f, proto, client_name, itag, po_token):
|
|||
|
||||
subtitles = {}
|
||||
for sd in streaming_data:
|
||||
client_name = sd.get(STREAMING_DATA_CLIENT_NAME)
|
||||
client_name = sd[STREAMING_DATA_CLIENT_NAME]
|
||||
po_token = sd.get(STREAMING_DATA_PO_TOKEN)
|
||||
hls_manifest_url = 'hls' not in skip_manifests and sd.get('hlsManifestUrl')
|
||||
if hls_manifest_url:
|
||||
|
|
Loading…
Reference in a new issue