diff options
author | Remita Amine <remitamine@gmail.com> | 2016-12-10 17:17:13 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2016-12-10 17:22:15 +0100 |
commit | 8821a718cfeca740d42d109411645427d4f8b523 (patch) | |
tree | 221b4d262b611aed65375558ef5d2375e43a6f36 /youtube_dl/extractor/common.py | |
parent | 0d7d9f94045868d22493d4932d124170d26511fe (diff) |
[common] recognize hls manifests that contain video only formats(#11394)
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r-- | youtube_dl/extractor/common.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 05c51fac9..6ae946569 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -1224,6 +1224,7 @@ class InfoExtractor(object): 'protocol': entry_protocol, 'preference': preference, }] + audio_groups = set() last_info = {} last_media = {} for line in m3u8_doc.splitlines(): @@ -1239,15 +1240,18 @@ class InfoExtractor(object): for v in (media.get('GROUP-ID'), media.get('NAME')): if v: format_id.append(v) - formats.append({ + f = { 'format_id': '-'.join(format_id), 'url': format_url(media_url), 'language': media.get('LANGUAGE'), - 'vcodec': 'none' if media_type == 'AUDIO' else None, 'ext': ext, 'protocol': entry_protocol, 'preference': preference, - }) + } + if media_type == 'AUDIO': + f['vcodec'] = 'none' + audio_groups.add(media['GROUP-ID']) + formats.append(f) else: # When there is no URI in EXT-X-MEDIA let this tag's # data be used by regular URI lines below @@ -1295,6 +1299,9 @@ class InfoExtractor(object): 'abr': abr, }) f.update(parse_codecs(last_info.get('CODECS'))) + if last_info.get('AUDIO') in audio_groups: + # TODO: update acodec for for audio only formats with the same GROUP-ID + f['acodec'] = 'none' formats.append(f) last_info = {} last_media = {} |