]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/extractors.py
[ie/matchtv] Fix extractor (#10190)
[yt-dlp.git] / yt_dlp / extractor / extractors.py
CommitLineData
560738f3 1import contextlib
2import os
3
8e40b9d1 4from ..plugins import load_plugins
560738f3 5
2314b4d8 6# NB: Must be before other imports so that plugins can be correctly injected
8e40b9d1 7_PLUGIN_CLASSES = load_plugins('extractor', 'IE')
2314b4d8 8
560738f3 9_LAZY_LOADER = False
10if not os.environ.get('YTDLP_NO_LAZY_EXTRACTORS'):
11 with contextlib.suppress(ImportError):
12 from .lazy_extractors import * # noqa: F403
13 from .lazy_extractors import _ALL_CLASSES
14 _LAZY_LOADER = True
15
16if not _LAZY_LOADER:
17 from ._extractors import * # noqa: F403
18 _ALL_CLASSES = [ # noqa: F811
19 klass
20 for name, klass in globals().items()
21 if name.endswith('IE') and name != 'GenericIE'
22 ]
23 _ALL_CLASSES.append(GenericIE) # noqa: F405
24
2314b4d8 25globals().update(_PLUGIN_CLASSES)
26_ALL_CLASSES[:0] = _PLUGIN_CLASSES.values()
e756f45b
M
27
28from .common import _PLUGIN_OVERRIDES # noqa: F401