if not _LAZY_LOADER:
from .extractors import *
-
- _PLUGIN_CLASSES = load_plugins('extractor', 'IE', globals())
-
_ALL_CLASSES = [
klass
for name, klass in globals().items()
]
_ALL_CLASSES.append(GenericIE)
+ _PLUGIN_CLASSES = load_plugins('extractor', 'IE', globals())
+ _ALL_CLASSES = _PLUGIN_CLASSES + _ALL_CLASSES
+
def gen_extractor_classes():
""" Return a list of supported extractors.
return os.path.abspath(path)
-def load_plugins(name, type, namespace):
+def load_plugins(name, suffix, namespace):
plugin_info = [None]
classes = []
try:
name, [os.path.join(get_executable_path(), 'ytdlp_plugins')])
plugins = imp.load_module(name, *plugin_info)
for name in dir(plugins):
- if not name.endswith(type):
+ if name in namespace:
+ continue
+ if not name.endswith(suffix):
continue
klass = getattr(plugins, name)
classes.append(klass)