mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-07 20:30:41 -05:00
[extractor/youtube] Extract more format info
This commit is contained in:
parent
b8ed0f15d4
commit
a416623436
1 changed files with 8 additions and 1 deletions
|
@ -2254,6 +2254,10 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
|||
'tags': [],
|
||||
'uploader_url': 'http://www.youtube.com/user/nao20010128nao',
|
||||
}
|
||||
}, {
|
||||
'note': '6 channel audio',
|
||||
'url': 'https://www.youtube.com/watch?v=zgdo7-RRjgo',
|
||||
'only_matching': True,
|
||||
}
|
||||
]
|
||||
|
||||
|
@ -3253,10 +3257,13 @@ def _extract_formats_and_subtitles(self, streaming_data, video_id, player_url, i
|
|||
'%s%s' % (audio_track.get('displayName') or '',
|
||||
' (default)' if language_preference > 0 else ''),
|
||||
fmt.get('qualityLabel') or quality.replace('audio_quality_', ''),
|
||||
try_get(fmt, lambda x: x['projectionType'].replace('RECTANGULAR', '').lower()),
|
||||
try_get(fmt, lambda x: x['spatialAudioType'].replace('SPATIAL_AUDIO_TYPE_', '').lower()),
|
||||
throttled and 'THROTTLED', is_damaged and 'DAMAGED', delim=', '),
|
||||
# Format 22 is likely to be damaged. See https://github.com/yt-dlp/yt-dlp/issues/3372
|
||||
'source_preference': -10 if throttled else -5 if itag == '22' else -1,
|
||||
'fps': int_or_none(fmt.get('fps')) or None,
|
||||
'audio_channels': fmt.get('audioChannels'),
|
||||
'height': height,
|
||||
'quality': q(quality),
|
||||
'has_drm': bool(fmt.get('drmFamilies')),
|
||||
|
@ -3577,7 +3584,7 @@ def feed_entry(name):
|
|||
formats.extend(self._extract_storyboard(player_responses, duration))
|
||||
|
||||
# source_preference is lower for throttled/potentially damaged formats
|
||||
self._sort_formats(formats, ('quality', 'res', 'fps', 'hdr:12', 'source', 'codec:vp9.2', 'lang', 'proto'))
|
||||
self._sort_formats(formats, ('quality', 'res', 'fps', 'hdr:12', 'channels', 'source', 'codec:vp9.2', 'lang', 'proto'))
|
||||
|
||||
info = {
|
||||
'id': video_id,
|
||||
|
|
Loading…
Reference in a new issue