mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-27 14:14:54 +01:00
[common] Improve codecs extraction from m3u8
This commit is contained in:
parent
2582bebe06
commit
9ebf22b7d9
|
@ -677,9 +677,12 @@ def _extract_m3u8_formats(self, m3u8_url, video_id, ext=None):
|
||||||
}
|
}
|
||||||
codecs = last_info.get('CODECS')
|
codecs = last_info.get('CODECS')
|
||||||
if codecs:
|
if codecs:
|
||||||
video, audio = codecs.split(',')
|
# TODO: looks like video codec is not always necessarily goes first
|
||||||
f['vcodec'] = video.partition('.')[0]
|
va_codecs = codecs.split(',')
|
||||||
f['acodec'] = audio.partition('.')[0]
|
if va_codecs[0]:
|
||||||
|
f['vcodec'] = va_codecs[0].partition('.')[0]
|
||||||
|
if len(va_codecs) > 1 and va_codecs[1]:
|
||||||
|
f['acodec'] = va_codecs[1].partition('.')[0]
|
||||||
resolution = last_info.get('RESOLUTION')
|
resolution = last_info.get('RESOLUTION')
|
||||||
if resolution:
|
if resolution:
|
||||||
width_str, height_str = resolution.split('x')
|
width_str, height_str = resolution.split('x')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user