bastimeyer · GitHub

Resolves #6632

This adds --skip in addition to the already existing --force CLI argument.

With --skip set, no prompt will be made for overwriting the output file if it already exists, and Streamlink will immediately exit. --skip takes precedence over --force, if set.

$ echo 123 > /tmp/foo
$ touch /tmp/bar
$ streamlink httpstream://file:///tmp/foo best -o /tmp/bar
[cli][info] Found matching plugin http for URL httpstream://file:///tmp/foo
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (http)
[cli][info] Writing output to
/tmp/bar
File /tmp/bar already exists! Overwrite it? [y/N]
$ streamlink httpstream://file:///tmp/foo best -o /tmp/bar --skip
[cli][info] Found matching plugin http for URL httpstream://file:///tmp/foo
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (http)
[cli][info] Writing output to
/tmp/bar
[cli][error] File /tmp/bar already exists
$ streamlink httpstream://file:///tmp/foo best -o /tmp/bar --force --skip
[cli][info] Found matching plugin http for URL httpstream://file:///tmp/foo
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (http)
[cli][info] Writing output to
/tmp/bar
[cli][error] File /tmp/bar already exists
$ streamlink httpstream://file:///tmp/foo best -o /tmp/bar --force
[cli][info] Found matching plugin http for URL httpstream://file:///tmp/foo
[cli][info] Available streams: live (worst, best)
[cli][info] Opening stream: live (http)
[cli][info] Writing output to
/tmp/bar
[cli][info] Stream ended
[cli][info] Closing currently open stream...
[download] Written 4 bytes to /tmp/bar (0s)

Read the original on github.com ↗