aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-09-22 00:15:56 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-09-22 00:20:41 +0530
commit96933fc1b6043060498f2c85c25457bd526ba793 (patch)
tree10a70ac1bf82edeac836dc6019d9c34f24bf00e7 /yt_dlp
parent0d32e124c69c5d53eb9dd286aa6147ec4cf52e54 (diff)
downloadhypervideo-pre-96933fc1b6043060498f2c85c25457bd526ba793.tar.lz
hypervideo-pre-96933fc1b6043060498f2c85c25457bd526ba793.tar.xz
hypervideo-pre-96933fc1b6043060498f2c85c25457bd526ba793.zip
[aria2c] Fix IV for some AES-128 streams
Authored by: shirt
Diffstat (limited to 'yt_dlp')
-rw-r--r--yt_dlp/downloader/external.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt_dlp/downloader/external.py b/yt_dlp/downloader/external.py
index 1057382e0..a0d346c12 100644
--- a/yt_dlp/downloader/external.py
+++ b/yt_dlp/downloader/external.py
@@ -11,6 +11,7 @@ from ..aes import aes_cbc_decrypt_bytes
from ..compat import (
compat_setenv,
compat_str,
+ compat_struct_pack,
)
from ..postprocessor.ffmpeg import FFmpegPostProcessor, EXT_TO_OUT_FORMATS
from ..utils import (
@@ -155,7 +156,7 @@ class ExternalFD(FileDownloader):
decrypt_info = fragment.get('decrypt_info')
if decrypt_info:
if decrypt_info['METHOD'] == 'AES-128':
- iv = decrypt_info.get('IV')
+ iv = decrypt_info.get('IV') or compat_struct_pack('>8xq', fragment['media_sequence'])
decrypt_info['KEY'] = decrypt_info.get('KEY') or self.ydl.urlopen(
self._prepare_url(info_dict, info_dict.get('_decryption_key_url') or decrypt_info['URI'])).read()
encrypted_data = src.read()