From e154c65128305fcaf6c6b2d5fd41ecd83e4ec154 Mon Sep 17 00:00:00 2001 From: remitamine Date: Sun, 10 Jan 2016 20:09:53 +0100 Subject: [downloader/hls] Add support for AES-128 encrypted segments in hlsnative downloader --- youtube_dl/utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'youtube_dl/utils.py') diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 82f67f6cd..562031fe1 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -2852,3 +2852,12 @@ def decode_packed_codes(code): return re.sub( r'\b(\w+)\b', lambda mobj: symbol_table[mobj.group(0)], obfucasted_code) + + +def parse_m3u8_attributes(attrib): + info = {} + for (key, val) in re.findall(r'(?P[A-Z0-9-]+)=(?P"[^"]+"|[^",]+)(?:,|$)', attrib): + if val.startswith('"'): + val = val[1:-1] + info[key] = val + return info -- cgit v1.2.3