Skip to content

cli: add --plugin-dir, deprecate --plugin-dirs #5866

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bastimeyer
Copy link
Member

See #5865

--plugin-dirs is a comma_list argument, which isn't ideal for path values. This therefore adds the --plugin-dir argument, which can be set multiple times with only one single path as argument value. Both argument values are merged into the plugin_dirs attribute on the arguments namespace object, so no changes are needed. But this also means that there's no deprecation warning when using the old argument.

$ streamlink -l debug --plugin-dir /tmp/foo --plugin-dir /tmp/bar --plugin-dirs /tmp/baz,/tmp/qux
[cli][warning] Plugin path /tmp/foo does not exist or is not a directory!
[cli][warning] Plugin path /tmp/bar does not exist or is not a directory!
[cli][warning] Plugin path /tmp/baz does not exist or is not a directory!
[cli][warning] Plugin path /tmp/qux does not exist or is not a directory!
[cli][debug] OS:         Linux-6.7.6-1-git-x86_64-with-glibc2.39
[cli][debug] Python:     3.12.2
[cli][debug] OpenSSL:    OpenSSL 3.2.1 30 Jan 2024
[cli][debug] Streamlink: 6.6.2+6.geef44a16
[cli][debug] Dependencies:
[cli][debug]  certifi: 2024.2.2
[cli][debug]  isodate: 0.6.1
[cli][debug]  lxml: 5.1.0
[cli][debug]  pycountry: 23.12.11
[cli][debug]  pycryptodome: 3.20.0
[cli][debug]  PySocks: 1.7.1
[cli][debug]  requests: 2.31.0
[cli][debug]  trio: 0.24.0
[cli][debug]  trio-websocket: 0.11.1
[cli][debug]  typing-extensions: 4.9.0
[cli][debug]  urllib3: 2.2.1
[cli][debug]  websocket-client: 1.7.0
[cli][debug] Arguments:
[cli][debug]  --plugin-dir=['/tmp/foo', '/tmp/bar', '/tmp/baz', '/tmp/qux']
[cli][debug]  --loglevel=debug
[cli][debug]  --player=/usr/bin/mpv
usage: streamlink [OPTIONS] <URL> [STREAM]

Use -h/--help to see the available options or read the manual at https://streamlink.github.io

@bastimeyer bastimeyer added the CLI label Feb 25, 2024
@bastimeyer bastimeyer force-pushed the cli/argparse/add-plugin-dir branch from eef44a1 to adf44c4 Compare February 25, 2024 19:44
@bastimeyer bastimeyer merged commit 70d5d4a into streamlink:master Mar 8, 2024
@bastimeyer bastimeyer deleted the cli/argparse/add-plugin-dir branch March 8, 2024 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants