You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
yt-dlp/yt_dlp/extractor/extractors.py

26 lines
635 B
Python

2 years ago
import inspect
import os
2 years ago
from ..globals import LAZY_EXTRACTORS, extractors
2 years ago
_CLASS_LOOKUP = None
if not os.environ.get('YTDLP_NO_LAZY_EXTRACTORS'):
2 years ago
try:
from .lazy_extractors import _CLASS_LOOKUP
LAZY_EXTRACTORS.set(True)
except ImportError:
LAZY_EXTRACTORS.set(None)
2 years ago
if not _CLASS_LOOKUP:
from . import _extractors
2 years ago
_CLASS_LOOKUP = {
name: value
for name, value in inspect.getmembers(_extractors)
if name.endswith('IE') and name != 'GenericIE'
}
_CLASS_LOOKUP['GenericIE'] = _extractors.GenericIE
2 years ago
extractors.set(_CLASS_LOOKUP)
globals().update(_CLASS_LOOKUP)