Skip to content

cli: add --progress={yes,no,force} CLI argument #5268

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
merged 2 commits into from
Mar 31, 2023

Conversation

bastimeyer
Copy link
Member

This adds support for suppressing the progress output when writing to a file by setting --progress=no.

Instead of adding a new --no-progress CLI argument, I decided to add --progress={yes,no,force} with default value yes and deprecate --force-progress.

$ streamlink --output=/dev/null httpstream://file:///dev/zero best
[cli][info] Found matching plugin http for URL httpstream://file:///dev/zero
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (http)
[cli][info] Writing output to
/dev/null
[download] Written 989.41 MiB to /dev/null (1s)
^C
[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...
$ streamlink --progress=no --output=/dev/null httpstream://file:///dev/zero best
[cli][info] Found matching plugin http for URL httpstream://file:///dev/zero
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (http)
[cli][info] Writing output to
/dev/null
^C
[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...
$ streamlink --progress=force --output=/dev/null httpstream://file:///dev/zero best
[cli][info] Found matching plugin http for URL httpstream://file:///dev/zero
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (http)
[cli][info] Writing output to
/dev/null
[download] Written 950.36 MiB to /dev/null (1s)
^C
[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...
$ streamlink --force-progress --output=/dev/null httpstream://file:///dev/zero best
[cli][info] Found matching plugin http for URL httpstream://file:///dev/zero
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (http)
[cli][info] Writing output to
/dev/null
[warnings][streamlinkdeprecation] The --force-progress option has been deprecated in favor of --progress=force
[download] Written 1005.53 MiB to /dev/null (1s)
^C
[cli][info] Stream ended
Interrupted! Exiting...
[cli][info] Closing currently open stream...

- Add `--progress` CLI argument and fix order of output arguments
- Deprecate `--force-progress` in favor of `--progress=force`
- Move progress check from `StreamRunner` to `output_stream()`
  and update signature of `StreamRunner` constructor
- Update tests
@bastimeyer bastimeyer added the CLI label Mar 31, 2023
@gravyboat gravyboat merged commit e9304ed into streamlink:master Mar 31, 2023
@bastimeyer bastimeyer deleted the cli/argparse-progress branch March 31, 2023 17:15
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