From b887cee909d4b7cafea28f814bfe2b8ac8f06d7b Mon Sep 17 00:00:00 2001 From: Mike Kazantsev Date: Thu, 6 Jun 2024 01:14:01 +0500 Subject: [PATCH] desktop.media.streamdump: restore dry-run option --- desktop/media/streamdump | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/media/streamdump b/desktop/media/streamdump index 93a2894..074b328 100755 --- a/desktop/media/streamdump +++ b/desktop/media/streamdump @@ -5,11 +5,10 @@ slink_opts=( --retry-streams 120 --retry-open 3 slink_fmt=720p,720p60,480p,best yt_check_interval=3m yt_check_interval_done=10m -dry_run= bin=$(basename $0) usage() { - echo >&2 "Usage: $bin [+runtime] [streamlink-opts] [-- [fmt]] url dump[.mp4]" + echo >&2 "Usage: $bin [+runtime] [-x|--dry-run] [streamlink-opts] [-- [fmt]] url dump[.mp4]" echo >&2 echo >&2 "Examples:" echo >&2 " $bin twitch.tv/userX userX-stream1" @@ -33,6 +32,7 @@ grep -Pq '(^| -)(h|-help)( |$)' <<< "$*" && usage set -eo pipefail [[ "${1:0:1}" != + ]] || { cg_arg=${1:1}; shift; } +[[ "$1" != -x && "$1" != --dry-run ]] && dry_run= || { dry_run=t; shift; } fmt=$slink_fmt cmd=( streamlink "${slink_opts[@]}" ) while [[ "$#" -gt 2 ]]; do