From 899684f3ce208c9e330eaf8da9cc804a13049305 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Wed, 13 Oct 2021 20:40:14 -0700 Subject: [PATCH] properly ignore `--ytdl-format` and warn about it --- sh/streamcrap | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sh/streamcrap b/sh/streamcrap index c165f19..7c55165 100644 --- a/sh/streamcrap +++ b/sh/streamcrap @@ -72,14 +72,16 @@ mpv_watch() { ### @- argc -ge 1 "$0" "$@" || return pushd ~/play >/dev/null local url="$1"; shift - # checking for redundant flags might itself be redundant, but i want to be sure. - local seen=0 - for a; do [ "$a" = "${a#--ytdl-format=}" ] || seen=1; done + + local seen=0 A=() + for a; do [ "$a" = "${a#--ytdl-format}" ] && A+=("$a") || seen=1; done + [ $seen = 0 ] || printf '%s\n' 'NOTE: the --ytdl-format flag is temporarily ignored due to throttling issues.' >&2 + mpv \ --af=lavfi="[$_M_PROCESS]" \ --ytdl-format=best \ --ytdl-raw-options-append=compat-options=all \ - "$@" -- "$url" + "${A[@]}" -- "$url" popd >/dev/null }