aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/compat.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-09-18 00:51:27 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-09-18 00:55:58 +0530
commitedf65256aa630a5ce011138e8957c95c9bef0584 (patch)
treefa1f3c3b18db2afb6f47081355c4fd23f4ae975b /yt_dlp/compat.py
parent7303f84abeeb283b15806f7ef47bfe694f55b99c (diff)
downloadhypervideo-pre-edf65256aa630a5ce011138e8957c95c9bef0584.tar.lz
hypervideo-pre-edf65256aa630a5ce011138e8957c95c9bef0584.tar.xz
hypervideo-pre-edf65256aa630a5ce011138e8957c95c9bef0584.zip
[hls,aes] Fallback to native implementation for AES-CBC
and detect `Cryptodome` in addition to `Crypto` Closes #935 Related: #938
Diffstat (limited to 'yt_dlp/compat.py')
-rw-r--r--yt_dlp/compat.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/yt_dlp/compat.py b/yt_dlp/compat.py
index 363c2d57a..7b55b7d9d 100644
--- a/yt_dlp/compat.py
+++ b/yt_dlp/compat.py
@@ -148,6 +148,15 @@ else:
compat_expanduser = os.path.expanduser
+try:
+ from Cryptodome.Cipher import AES as compat_pycrypto_AES
+except ImportError:
+ try:
+ from Crypto.Cipher import AES as compat_pycrypto_AES
+ except ImportError:
+ compat_pycrypto_AES = None
+
+
# Deprecated
compat_basestring = str
@@ -241,6 +250,7 @@ __all__ = [
'compat_os_name',
'compat_parse_qs',
'compat_print',
+ 'compat_pycrypto_AES',
'compat_realpath',
'compat_setenv',
'compat_shlex_quote',