mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-11-08 02:25:13 +00:00
[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
This commit is contained in:
30
yt_dlp/globals.py
Normal file
30
yt_dlp/globals.py
Normal file
@@ -0,0 +1,30 @@
|
||||
from collections import defaultdict
|
||||
|
||||
# Please Note: Due to necessary changes and the complex nature involved in the plugin/globals system,
|
||||
# no backwards compatibility is guaranteed for the plugin system API.
|
||||
# However, we will still try our best.
|
||||
|
||||
|
||||
class Indirect:
|
||||
def __init__(self, initial, /):
|
||||
self.value = initial
|
||||
|
||||
def __repr__(self, /):
|
||||
return f'{type(self).__name__}({self.value!r})'
|
||||
|
||||
|
||||
postprocessors = Indirect({})
|
||||
extractors = Indirect({})
|
||||
|
||||
# Plugins
|
||||
all_plugins_loaded = Indirect(False)
|
||||
plugin_specs = Indirect({})
|
||||
plugin_dirs = Indirect(['default'])
|
||||
|
||||
plugin_ies = Indirect({})
|
||||
plugin_pps = Indirect({})
|
||||
plugin_ies_overrides = Indirect(defaultdict(list))
|
||||
|
||||
# Misc
|
||||
IN_CLI = Indirect(False)
|
||||
LAZY_EXTRACTORS = Indirect(False) # `False`=force, `None`=disabled, `True`=enabled
|
||||
Reference in New Issue
Block a user