From 600b2ece36f25c4439cff497bd77017686de1972 Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Sat, 30 Nov 2024 14:05:58 +1300 Subject: [PATCH] Avoid searching disk for plugins when plugins are disabled --- yt_dlp/plugins.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yt_dlp/plugins.py b/yt_dlp/plugins.py index d91ebf2ef..2e88579e1 100644 --- a/yt_dlp/plugins.py +++ b/yt_dlp/plugins.py @@ -158,6 +158,9 @@ class PluginFinder(importlib.abc.MetaPathFinder): write_string(f'Permission error while accessing modules in "{e.filename}"\n') def find_spec(self, fullname, path=None, target=None): + if not plugins_enabled.value: + return None + if fullname not in self.packages: return None