[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': [],
|
'tags': [],
|
||||||
'uploader_url': 'http://www.youtube.com/user/nao20010128nao',
|
'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 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||||
'%s%s' % (audio_track.get('displayName') or '',
|
'%s%s' % (audio_track.get('displayName') or '',
|
||||||
' (default)' if language_preference > 0 else ''),
|
' (default)' if language_preference > 0 else ''),
|
||||||
fmt.get('qualityLabel') or quality.replace('audio_quality_', ''),
|
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=', '),
|
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
|
# 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,
|
'source_preference': -10 if throttled else -5 if itag == '22' else -1,
|
||||||
'fps': int_or_none(fmt.get('fps')) or None,
|
'fps': int_or_none(fmt.get('fps')) or None,
|
||||||
|
'audio_channels': fmt.get('audioChannels'),
|
||||||
'height': height,
|
'height': height,
|
||||||
'quality': q(quality),
|
'quality': q(quality),
|
||||||
'has_drm': bool(fmt.get('drmFamilies')),
|
'has_drm': bool(fmt.get('drmFamilies')),
|
||||||
|
@ -3577,7 +3584,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
|
||||||
formats.extend(self._extract_storyboard(player_responses, duration))
|
formats.extend(self._extract_storyboard(player_responses, duration))
|
||||||
|
|
||||||
# source_preference is lower for throttled/potentially damaged formats
|
# 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 = {
|
info = {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
|
Loading…
Reference in a new issue