[cleanup] Misc fixes
Closes #3565, https://github.com/yt-dlp/yt-dlp/issues/3514#issuecomment-1105944364
This commit is contained in:
parent
0a41f331cc
commit
1d485a1a79
19 changed files with 75 additions and 42 deletions
|
|
@ -1,4 +1,6 @@
|
|||
# flake8: noqa: F401
|
||||
"""Imports all optional dependencies for the project.
|
||||
An attribute "_yt_dlp__identifier" may be inserted into the module if it uses an ambigious namespace"""
|
||||
|
||||
try:
|
||||
import brotlicffi as brotli
|
||||
|
|
@ -28,6 +30,15 @@ except ImportError:
|
|||
from Crypto.Cipher import AES as Cryptodome_AES
|
||||
except ImportError:
|
||||
Cryptodome_AES = None
|
||||
else:
|
||||
try:
|
||||
# In pycrypto, mode defaults to ECB. See:
|
||||
# https://www.pycryptodome.org/en/latest/src/vs_pycrypto.html#:~:text=not%20have%20ECB%20as%20default%20mode
|
||||
Cryptodome_AES.new(b'abcdefghijklmnop')
|
||||
except TypeError:
|
||||
pass
|
||||
else:
|
||||
Cryptodome_AES._yt_dlp__identifier = 'pycrypto'
|
||||
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue