]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[downloader/hls] Use HTTP headers for key request
authorSergey M․ <dstftw@gmail.com>
Sat, 30 Dec 2017 18:15:35 +0000 (01:15 +0700)
committerSergey M․ <dstftw@gmail.com>
Sat, 30 Dec 2017 18:15:35 +0000 (01:15 +0700)
youtube_dl/downloader/hls.py

index 1a6e226c89c809acec5a011b943043e7314d2cfd..4dc3ab46aa534132862ef0c29c34c871996ea2e4 100644 (file)
@@ -163,7 +163,8 @@ class HlsFD(FragmentFD):
                         return False
                     if decrypt_info['METHOD'] == 'AES-128':
                         iv = decrypt_info.get('IV') or compat_struct_pack('>8xq', media_sequence)
-                        decrypt_info['KEY'] = decrypt_info.get('KEY') or self.ydl.urlopen(decrypt_info['URI']).read()
+                        decrypt_info['KEY'] = decrypt_info.get('KEY') or self.ydl.urlopen(
+                            self._prepare_url(info_dict, decrypt_info['URI'])).read()
                         frag_content = AES.new(
                             decrypt_info['KEY'], AES.MODE_CBC, iv).decrypt(frag_content)
                     self._append_fragment(ctx, frag_content)