]>
jfr.im git - yt-dlp.git/blob - yt_dlp/dependencies/Cryptodome.py
3 from ..compat
import functools
4 from ..compat
.compat_utils
import passthrough_module
7 import Cryptodome
as _parent
10 import Crypto
as _parent
11 except (ImportError, SyntaxError): # Old Crypto gives SyntaxError in newer Python
12 _parent
= types
.ModuleType('no_Cryptodome')
13 __bool__
= lambda: False
15 passthrough_module(__name__
, _parent
, (..., '__version__'))
16 del passthrough_module
21 def _yt_dlp__identifier():
22 if _parent
.__name
__ == 'Crypto':
23 from Crypto
.Cipher
import AES
25 # In pycrypto, mode defaults to ECB. See:
26 # https://www.pycryptodome.org/en/latest/src/vs_pycrypto.html#:~:text=not%20have%20ECB%20as%20default%20mode
27 AES
.new(b
'abcdefghijklmnop')
30 return _parent
.__name
__