diff options
author | Yen Chi Hsuan <[email protected]> | 2016-06-19 13:25:08 +0800 |
---|---|---|
committer | GitHub <[email protected]> | 2016-06-19 13:25:08 +0800 |
commit | 6aeb64b67358176f6c29965d0d138be75c2ad972 (patch) | |
tree | 51ac9e69175c3174bdbcf281b9bcf6fa651b9a1f /youtube_dl/extractor | |
parent | 6cd64b6806e92b7246aebd89448189180d88db82 (diff) | |
parent | e154c65128305fcaf6c6b2d5fd41ecd83e4ec154 (diff) | |
download | youtube-dl-6aeb64b67358176f6c29965d0d138be75c2ad972.tar.gz youtube-dl-6aeb64b67358176f6c29965d0d138be75c2ad972.zip |
Merge pull request #8201 from remitamine/hls-aes
[downloader/hls] Add support for AES-128 encrypted segments in hlsnative downloader
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/common.py | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index bfd432160..5a2603b50 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -53,6 +53,7 @@ from ..utils import ( mimetype2ext, update_Request, update_url_query, + parse_m3u8_attributes, ) @@ -1150,23 +1151,11 @@ class InfoExtractor(object): }] last_info = None last_media = None - kv_rex = re.compile( - r'(?P<key>[a-zA-Z_-]+)=(?P<val>"[^"]+"|[^",]+)(?:,|$)') for line in m3u8_doc.splitlines(): if line.startswith('#EXT-X-STREAM-INF:'): - last_info = {} - for m in kv_rex.finditer(line): - v = m.group('val') - if v.startswith('"'): - v = v[1:-1] - last_info[m.group('key')] = v + last_info = parse_m3u8_attributes(line) elif line.startswith('#EXT-X-MEDIA:'): - last_media = {} - for m in kv_rex.finditer(line): - v = m.group('val') - if v.startswith('"'): - v = v[1:-1] - last_media[m.group('key')] = v + last_media = parse_m3u8_attributes(line) elif line.startswith('#') or not line.strip(): continue else: |