diff --git a/yt b/yt index f743c44..4f8bcd7 100755 --- a/yt +++ b/yt @@ -103,7 +103,7 @@ pick() { # Pick a video to play from a list of videos shift done - chosen="$(printf '%s\n' "$list" | fzf | sed -e 's/.*\[//g' -e 's/\]//g')" + chosen="$(printf '%s\n' "$list" | $YTPICK | sed -e 's/.*\[//g' -e 's/\]//g')" test -n "$chosen" && mpv "$chosen" } @@ -172,13 +172,17 @@ cachefile="$XDG_CACHE_HOME/yt.cache" FMT='%(title)s – %(channel)s (%(duration>%H:%M:%S)s) [%(webpage_url)s]' WBAPI='https://archive.org/wayback/available?url=' +if test -z "$YTPICK"; then + printf "%s: \$YTPICK unset." 1>&2 + exit 78 # sysexits.h(3) EX_CONFIG +fi + if test -n "$DEBUG"; then set -x fi for dep in \ curl \ - fzf \ jq \ mpv \ yt-dlp