]>
Commit | Line | Data |
---|---|---|
560738f3 | 1 | import contextlib |
2 | import os | |
3 | ||
4 | from ..utils import load_plugins | |
5 | ||
6 | _LAZY_LOADER = False | |
7 | if not os.environ.get('YTDLP_NO_LAZY_EXTRACTORS'): | |
8 | with contextlib.suppress(ImportError): | |
9 | from .lazy_extractors import * # noqa: F403 | |
10 | from .lazy_extractors import _ALL_CLASSES | |
11 | _LAZY_LOADER = True | |
12 | ||
13 | if not _LAZY_LOADER: | |
14 | from ._extractors import * # noqa: F403 | |
15 | _ALL_CLASSES = [ # noqa: F811 | |
16 | klass | |
17 | for name, klass in globals().items() | |
18 | if name.endswith('IE') and name != 'GenericIE' | |
19 | ] | |
20 | _ALL_CLASSES.append(GenericIE) # noqa: F405 | |
21 | ||
22 | _PLUGIN_CLASSES = load_plugins('extractor', 'IE', globals()) | |
23 | _ALL_CLASSES = list(_PLUGIN_CLASSES.values()) + _ALL_CLASSES |