Plugin support

Extractor plugins are loaded from <root-dir>/ytdlp_plugins/extractor/__init__.py

Inspired by https://github.com/un-def/dl-plus

:ci skip dl
This commit is contained in:
pukkandan
2021-01-24 19:10:02 +05:30
parent c571435f9c
commit f74980cbae
9 changed files with 72 additions and 14 deletions

View File

@@ -1,13 +1,19 @@
from __future__ import unicode_literals
from ..utils import load_plugins
try:
from .lazy_extractors import *
from .lazy_extractors import _ALL_CLASSES
_LAZY_LOADER = True
_PLUGIN_CLASSES = []
except ImportError:
_LAZY_LOADER = False
from .extractors import *
_PLUGIN_CLASSES = load_plugins('extractor', 'IE', globals())
_ALL_CLASSES = [
klass
for name, klass in globals().items()