2 """Imports all optional dependencies for the project.
3 An attribute "_yt_dlp__identifier" may be inserted into the module if it uses an ambiguous namespace"""
6 import brotlicffi
as brotli
19 from os
.path
import exists
as _path_exists
21 # The certificate may not be bundled in executable
22 if not _path_exists(certifi
.where()):
35 _SECRETSTORAGE_UNAVAILABLE_REASON
= None
37 _SECRETSTORAGE_UNAVAILABLE_REASON
= (
38 'as the `secretstorage` module is not installed. '
39 'Please install by running `python3 -m pip install secretstorage`')
40 except Exception as _err
:
41 _SECRETSTORAGE_UNAVAILABLE_REASON
= f
'as the `secretstorage` module could not be initialized. {_err}'
47 # although sqlite3 is part of the standard library, it is possible to compile python without
48 # sqlite support. See: https://github.com/yt-dlp/yt-dlp/issues/544
54 except (ImportError, SyntaxError):
55 # websockets 3.10 on python 3.6 causes SyntaxError
56 # See https://github.com/yt-dlp/yt-dlp/issues/2633
61 import xattr
# xattr or pyxattr
65 if hasattr(xattr
, 'set'): # pyxattr
66 xattr
._yt
_dlp
__identifier
= 'pyxattr'
69 from . import Cryptodome
71 all_dependencies
= {k: v for k, v in globals().items() if not k.startswith('_')}
72 available_dependencies
= {k: v for k, v in all_dependencies.items() if v}
76 Cryptodome_AES
= Cryptodome
.AES
81 'available_dependencies',
82 *all_dependencies
.keys(),