diff --git a/yt b/yt index b97a5c0..6b22bc5 100755 --- a/yt +++ b/yt @@ -18,6 +18,19 @@ set -e +test -n "$DEBUG" \ + && set -x \ + || true # because set -e + +argv0="$0" +com="$1" +FMT='%(title)s – %(channel)s (%(duration>%H:%M:%S)s) [%(webpage_url)s]' + +test -n "$cachefile" \ + || cachefile="$XDG_CACHE_HOME/yt.cache" +test -n "$WBAPI" \ + || WBAPI='https://archive.org/wayback/available?url=' + add() { # adds a video to a playlist file while test -n "$2"; do if test -z "$(sed -n ";$1;p" "$2")" @@ -164,17 +177,6 @@ verify() { # replaces videos with archived versions if they are not available done } -argv0="$0" -com="$1" - -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 -n "$DEBUG"; then - set -x -fi - for dep in \ curl \ fzf \