diff --git a/README.md b/README.md index 4144afc2b..f2ded154d 100644 --- a/README.md +++ b/README.md @@ -338,10 +338,10 @@ If you fork the project on GitHub, you can run your fork's [build workflow](.git --plugin-dirs PATH Path to an additional directory to search for plugins. This option can be used multiple times to add multiple directories. - Note that this currently only works for - extractor plugins; postprocessor plugins can - only be loaded from the default plugin - directories + Add "no-external" to disable searching + default external plugin directories (outside + of python environment) + --no-plugins Do not load plugins --flat-playlist Do not extract a playlist's URL result entries; some entry metadata may be missing and downloading may be bypassed @@ -366,12 +366,6 @@ If you fork the project on GitHub, you can run your fork's [build workflow](.git sequences). Use "auto-tty" or "no_color-tty" to decide based on terminal support only. Can be used multiple times - --plugin-dirs PATH Directory to search for plugins. Can be used - multiple times to add multiple directories. - Add "no-external" to disable searching - default external plugin directories (outside - of python environment) - --no-plugins Do not load plugins --compat-options OPTS Options that can help keep compatibility with youtube-dl or youtube-dlc configurations by reverting some of the diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py index 3701297a3..b2fc846f9 100644 --- a/yt_dlp/__init__.py +++ b/yt_dlp/__init__.py @@ -38,7 +38,6 @@ from .postprocessor import ( ) from .update import Updater from .utils import ( - Config, NO_DEFAULT, POSTPROCESS_WHEN, DateRange, @@ -976,11 +975,6 @@ def _real_main(argv=None): parser, opts, all_urls, ydl_opts = parse_options(argv) - # HACK: Set the plugin dirs early on - # TODO(coletdjnz): remove when plugin globals system is implemented - if opts.plugin_dirs is not None: - Config._plugin_dirs = list(map(expand_path, opts.plugin_dirs)) - # Dump user agent if opts.dump_user_agent: ua = traverse_obj(opts.headers, 'User-Agent', casesense=False, default=std_headers['User-Agent']) diff --git a/yt_dlp/options.py b/yt_dlp/options.py index 10cf41578..d0e71f58b 100644 --- a/yt_dlp/options.py +++ b/yt_dlp/options.py @@ -410,12 +410,19 @@ def create_parser(): '("-" for stdin). Can be used multiple times and inside other configuration files')) general.add_option( '--plugin-dirs', - dest='plugin_dirs', metavar='PATH', action='append', + metavar='PATH', + dest='plugin_dirs', + action='append', help=( 'Path to an additional directory to search for plugins. ' 'This option can be used multiple times to add multiple directories. ' - 'Note that this currently only works for extractor plugins; ' - 'postprocessor plugins can only be loaded from the default plugin directories')) + 'Add "no-external" to disable searching default external plugin directories (outside of python environment)')) + general.add_option( + '--no-plugins', + dest='plugins_enabled', + action='store_false', + default=True, + help='Do not load plugins') general.add_option( '--flat-playlist', action='store_const', dest='extract_flat', const='in_playlist', default=False, @@ -474,24 +481,6 @@ def create_parser(): '"no_color" (use non color terminal sequences). ' 'Use "auto-tty" or "no_color-tty" to decide based on terminal support only. ' 'Can be used multiple times')) - - general.add_option( - '--plugin-dirs', - metavar='PATH', - dest='plugin_dirs', - action='append', - help=( - 'Directory to search for plugins. Can be used multiple times to add multiple directories. ' - 'Add "no-external" to disable searching default external plugin directories (outside of python environment)' - ), - ) - general.add_option( - '--no-plugins', - dest='plugins_enabled', - action='store_false', - default=True, - help='Do not load plugins', - ) general.add_option( '--compat-options', metavar='OPTS', dest='compat_opts', default=set(), type='str', diff --git a/yt_dlp/utils/_utils.py b/yt_dlp/utils/_utils.py index 1b44c07c3..5541d8c0f 100644 --- a/yt_dlp/utils/_utils.py +++ b/yt_dlp/utils/_utils.py @@ -4887,10 +4887,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(), []