aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/utils.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-05-08 20:45:14 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-05-09 04:22:27 +0530
commit2f567473c6001160138aeb43dd6096093dd5448e (patch)
treec001cfd3b02a988d8383b682d9e2373216975ac5 /yt_dlp/utils.py
parent000ee7ef3440349cd714f8bdfab4214648881805 (diff)
downloadhypervideo-pre-2f567473c6001160138aeb43dd6096093dd5448e.tar.lz
hypervideo-pre-2f567473c6001160138aeb43dd6096093dd5448e.tar.xz
hypervideo-pre-2f567473c6001160138aeb43dd6096093dd5448e.zip
[Plugins] Prioritize plugins over standard extractors
and prevent plugins from overwriting the standard extractor classes Closes #304
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r--yt_dlp/utils.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index baa2a415e..b80a8cedb 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -6081,7 +6081,7 @@ def get_executable_path():
return os.path.abspath(path)
-def load_plugins(name, type, namespace):
+def load_plugins(name, suffix, namespace):
plugin_info = [None]
classes = []
try:
@@ -6089,7 +6089,9 @@ def load_plugins(name, type, namespace):
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)