Cleanup after merge

This commit is contained in:
coletdjnz 2024-11-30 12:31:26 +13:00
parent 072e68020d
commit 2699951172
No known key found for this signature in database
GPG key ID: 91984263BB39894A
4 changed files with 14 additions and 41 deletions

View file

@ -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

View file

@ -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'])

View file

@ -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',

View file

@ -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(), []