diff options
author | remitamine <[email protected]> | 2016-01-10 20:09:53 +0100 |
---|---|---|
committer | Remita Amine <[email protected]> | 2016-06-19 01:01:40 +0100 |
commit | e154c65128305fcaf6c6b2d5fd41ecd83e4ec154 (patch) | |
tree | 09b3d7dfa5f9e0d8c2d930c94e7fd2b6d0a0684c /youtube_dl/extractor | |
parent | 589568789f500b7a515355a07efec4bcec0f3243 (diff) | |
download | youtube-dl-e154c65128305fcaf6c6b2d5fd41ecd83e4ec154.tar.gz youtube-dl-e154c65128305fcaf6c6b2d5fd41ecd83e4ec154.zip |
[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: |