aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/downloader/fragment.py
diff options
context:
space:
mode:
authorshirt <2660574+shirt-dev@users.noreply.github.com>2021-09-28 14:53:24 -0400
committerGitHub <noreply@github.com>2021-09-29 00:23:24 +0530
commit7687c8ac6e223a725b3ef8f56f04779bebdc86c5 (patch)
tree03178ebcf5ff2749ed0a170c1da749eaa2444f9d /yt_dlp/downloader/fragment.py
parent80c360d7aad7ccda48ccd13be62dbb6fc5a6f128 (diff)
downloadhypervideo-pre-7687c8ac6e223a725b3ef8f56f04779bebdc86c5.tar.lz
hypervideo-pre-7687c8ac6e223a725b3ef8f56f04779bebdc86c5.tar.xz
hypervideo-pre-7687c8ac6e223a725b3ef8f56f04779bebdc86c5.zip
[HLS] Fix decryption issues (#1117)
* Unpad HLS fragments with PKCS#7 according to datatracker.ietf.org/doc/html/rfc8216 * media_sequence should only be incremented in for media fragments * The native decryption should only be used if ffmpeg is unavailable since it is significantly slower. Closes #1086 Authored by: shirt-dev, pukkandan
Diffstat (limited to 'yt_dlp/downloader/fragment.py')
-rw-r--r--yt_dlp/downloader/fragment.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt_dlp/downloader/fragment.py b/yt_dlp/downloader/fragment.py
index 31f946792..22134f3b6 100644
--- a/yt_dlp/downloader/fragment.py
+++ b/yt_dlp/downloader/fragment.py
@@ -355,7 +355,8 @@ class FragmentFD(FileDownloader):
# not what it decrypts to.
if self.params.get('test', False):
return frag_content
- return aes_cbc_decrypt_bytes(frag_content, decrypt_info['KEY'], iv)
+ decrypted_data = aes_cbc_decrypt_bytes(frag_content, decrypt_info['KEY'], iv)
+ return decrypted_data[:-decrypted_data[-1]]
return decrypt_fragment