about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2017-12-31 01:15:35 +0700
committerSergey M․ <dstftw@gmail.com>2017-12-31 01:15:35 +0700
commit538d4f8681535507838d19942d2581478ebdc28b (patch)
treed0f73bdd60437a6a191fc2aaead7e81e88dd7d88
parent620ee8712e264c71b444748c86a51b258818b4a1 (diff)
downloadyoutube-dl-538d4f8681535507838d19942d2581478ebdc28b.tar.gz
youtube-dl-538d4f8681535507838d19942d2581478ebdc28b.tar.xz
youtube-dl-538d4f8681535507838d19942d2581478ebdc28b.zip
[downloader/hls] Use HTTP headers for key request
-rw-r--r--youtube_dl/downloader/hls.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/youtube_dl/downloader/hls.py b/youtube_dl/downloader/hls.py
index 1a6e226c8..4dc3ab46a 100644
--- a/youtube_dl/downloader/hls.py
+++ b/youtube_dl/downloader/hls.py
@@ -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)