1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-10-31 06:35:12 +00:00

[hls,aes] Fallback to native implementation for AES-CBC

and detect `Cryptodome` in addition to `Crypto`

Closes #935
Related: #938
This commit is contained in:
pukkandan
2021-09-18 00:51:27 +05:30
parent 7303f84abe
commit edf65256aa
9 changed files with 46 additions and 49 deletions

View File

@@ -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',