[downloader/hls] Add support for AES-128 encrypted segments in hlsnative downloader

This commit is contained in:
remitamine 2016-01-10 20:09:53 +01:00 committed by Remita Amine
parent 589568789f
commit e154c65128
3 changed files with 68 additions and 36 deletions

View file

@ -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<key>[A-Z0-9-]+)=(?P<val>"[^"]+"|[^",]+)(?:,|$)', attrib):
if val.startswith('"'):
val = val[1:-1]
info[key] = val
return info