2023-01-07 08:19:13 +01:00
|
|
|
import inspect
|
2022-06-15 18:00:34 +05:30
|
|
|
import os
|
|
|
|
|
2023-01-07 08:19:13 +01:00
|
|
|
from ..globals import LAZY_EXTRACTORS, extractors
|
2022-06-15 18:00:34 +05:30
|
|
|
|
2023-01-07 08:19:13 +01:00
|
|
|
_CLASS_LOOKUP = None
|
2022-06-15 18:00:34 +05:30
|
|
|
if not os.environ.get('YTDLP_NO_LAZY_EXTRACTORS'):
|
2023-01-07 08:19:13 +01:00
|
|
|
try:
|
|
|
|
from .lazy_extractors import _CLASS_LOOKUP
|
|
|
|
LAZY_EXTRACTORS.set(True)
|
|
|
|
except ImportError:
|
|
|
|
LAZY_EXTRACTORS.set(None)
|
2022-06-15 18:00:34 +05:30
|
|
|
|
2023-01-07 08:19:13 +01:00
|
|
|
if not _CLASS_LOOKUP:
|
|
|
|
from . import _extractors
|
2022-06-15 18:00:34 +05:30
|
|
|
|
2023-01-07 08:19:13 +01:00
|
|
|
_CLASS_LOOKUP = {
|
|
|
|
name: value
|
|
|
|
for name, value in inspect.getmembers(_extractors)
|
|
|
|
if name.endswith('IE') and name != 'GenericIE'
|
|
|
|
}
|
|
|
|
_CLASS_LOOKUP['GenericIE'] = _extractors.GenericIE
|
2023-01-02 04:55:11 +00:00
|
|
|
|
2023-01-07 08:19:13 +01:00
|
|
|
extractors.set(_CLASS_LOOKUP)
|
|
|
|
globals().update(_CLASS_LOOKUP)
|