aboutsummaryrefslogtreecommitdiff
path: root/yt_dlp/utils/_utils.py
diff options
context:
space:
mode:
authorcoletdjnz <coletdjnz@protonmail.com>2025-02-23 11:00:46 +1300
committerGitHub <noreply@github.com>2025-02-23 11:00:46 +1300
commit4445f37a7a66b248dbd8376c43137e6e441f138e (patch)
treeb37561f1213bc25420f1f1004e8b6c8560e8b92f /yt_dlp/utils/_utils.py
parent3a1583ca75fb523cbad0e5e174387ea7b477d175 (diff)
[core] Load plugins on demand (#11305)
- Adds `--no-plugin-dirs` to disable plugin loading - `--plugin-dirs` now supports post-processors Authored by: coletdjnz, Grub4K, pukkandan
Diffstat (limited to 'yt_dlp/utils/_utils.py')
-rw-r--r--yt_dlp/utils/_utils.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/yt_dlp/utils/_utils.py b/yt_dlp/utils/_utils.py
index 3e7a375ee..4093c238c 100644
--- a/yt_dlp/utils/_utils.py
+++ b/yt_dlp/utils/_utils.py
@@ -52,6 +52,7 @@ from ..compat import (
compat_HTMLParseError,
)
from ..dependencies import xattr
+from ..globals import IN_CLI
__name__ = __name__.rsplit('.', 1)[0] # noqa: A001: Pretend to be the parent module
@@ -1487,8 +1488,7 @@ def write_string(s, out=None, encoding=None):
# TODO: Use global logger
def deprecation_warning(msg, *, printer=None, stacklevel=0, **kwargs):
- from .. import _IN_CLI
- if _IN_CLI:
+ if IN_CLI.value:
if msg in deprecation_warning._cache:
return
deprecation_warning._cache.add(msg)
@@ -4891,10 +4891,6 @@ class Config:
filename = None
__initialized = False
- # Internal only, do not use! Hack to enable --plugin-dirs
- # TODO(coletdjnz): remove when plugin globals system is implemented
- _plugin_dirs = None
-
def __init__(self, parser, label=None):
self.parser, self.label = parser, label
self._loaded_paths, self.configs = set(), []