Skip to content
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

cli: deprecate --record-and-pipe #6194

Merged

Conversation

bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Sep 19, 2024

  1. cli: deprecate --record-and-pipe
    • Deprecate --record-and-pipe in favor of --stdout --record=FILENAME
    • Update argparse help texts
    • Update and rearrange create_output() tests
  2. cli: refactor check_file_output()
    Change return type to pathlib.Path, so that FileOutput objects are only initialized in create_output()
  3. cli: disallow --output=... --stdout
  4. docs: add -R/--record-and-pipe deprecation

--record-and-pipe was added in #2152 (1.0.0 release).

See #6192 (comment) for why I'm deprecating --record-and-pipe now.

This PR also disallows --output=... --stdout, rather than ignoring the --stdout argument when --output is set, as they are mutually exclusive arguments. Well, unless we change the behavior of --player and --output in the future, and make --output behave like --record (and then remove --record), as mentioned in the comment linked above. Different topic though...


--record-and-pipe=file (deprecated)

$ streamlink -l warning --record-and-pipe=/dev/null youtube.com/@hospitalrecords/live best | mpv -
[file] Reading from stdin...
[warnings][streamlinkdeprecation] -R/--record-and-pipe=... has been deprecated in favor of --stdout --record=...
 (+) Video --vid=1 (h264 1920x1080 30.000fps)
 (+) Audio --aid=1 (aac 2ch 44100Hz)
Using hardware decoding (vaapi).
AO: [pipewire] 44100Hz stereo 2ch floatp
VO: [gpu] 1920x1080 vaapi[nv12]
[download] Written 2.65 MiB to /dev/null (1s)

--stdout --record=file (now explicitly allowed)

$ streamlink -l warning --stdout --record=/dev/null youtube.com/@hospitalrecords/live best | mpv -
[file] Reading from stdin...
 (+) Video --vid=1 (h264 1920x1080 30.000fps)
 (+) Audio --aid=1 (aac 2ch 44100Hz)
Using hardware decoding (vaapi).
AO: [pipewire] 44100Hz stereo 2ch floatp
VO: [gpu] 1920x1080 vaapi[nv12]
[download] Written 2.29 MiB to /dev/null (0s)

--stdout --record=- (special case is handled correctly)

$ streamlink -l warning --stdout --record=- youtube.com/@hospitalrecords/live best | mpv -
[file] Reading from stdin...
 (+) Video --vid=1 (h264 1920x1080 30.000fps)
 (+) Audio --aid=1 (aac 2ch 44100Hz)
Using hardware decoding (vaapi).
AO: [pipewire] 44100Hz stereo 2ch floatp
VO: [gpu] 1920x1080 vaapi[nv12]

--stdout --output=file (now disallowed)

$ streamlink -l warning --stdout --output=/dev/null youtube.com/@hospitalrecords/live best | mpv -
[file] Reading from stdin...
error: The -o/--output argument is incompatible with -O/--stdout
Failed to recognize file format.
Exiting... (Errors when loading file)

@bastimeyer bastimeyer added the CLI label Sep 19, 2024
@bastimeyer
Copy link
Member Author

@bastimeyer bastimeyer force-pushed the cli/deprecate-record-and-pipe branch from f1ab449 to 005490f Compare September 19, 2024 16:23
- Deprecate `--record-and-pipe` in favor of `--stdout --record=FILENAME`
- Update argparse help texts
- Update and rearrange `create_output()` tests
Change return type to `pathlib.Path`, so that `FileOutput` objects
are only initialized in `create_output()`
@bastimeyer bastimeyer force-pushed the cli/deprecate-record-and-pipe branch from 005490f to 0c61732 Compare September 19, 2024 20:39
@bastimeyer bastimeyer merged commit f30df98 into streamlink:master Sep 19, 2024
25 checks passed
@bastimeyer bastimeyer deleted the cli/deprecate-record-and-pipe branch September 19, 2024 20:43
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