mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-04 12:25:03 -04:00
[extractor] Import _ALL_CLASSES
lazily
This significantly speeds up `import yt_dlp` in the absence of `lazy_extractors`
This commit is contained in:
@@ -38,8 +38,6 @@ from .compat import (
|
||||
from .cookies import load_cookies
|
||||
from .downloader import FFmpegFD, get_suitable_downloader, shorten_protocol_name
|
||||
from .downloader.rtmp import rtmpdump_version
|
||||
from .extractor import _LAZY_LOADER
|
||||
from .extractor import _PLUGIN_CLASSES as plugin_extractors
|
||||
from .extractor import gen_extractor_classes, get_info_extractor
|
||||
from .extractor.openload import PhantomJSwrapper
|
||||
from .minicurses import format_text
|
||||
@@ -3659,6 +3657,10 @@ class YoutubeDL:
|
||||
if not self.params.get('verbose'):
|
||||
return
|
||||
|
||||
# These imports can be slow. So import them only as needed
|
||||
from .extractor.extractors import _LAZY_LOADER
|
||||
from .extractor.extractors import _PLUGIN_CLASSES as plugin_extractors
|
||||
|
||||
def get_encoding(stream):
|
||||
ret = str(getattr(stream, 'encoding', 'missing (%s)' % type(stream).__name__))
|
||||
if not supports_terminal_sequences(stream):
|
||||
|
Reference in New Issue
Block a user