From 3714c0258838b2cb3a42311033b0b811ad77f78b Mon Sep 17 00:00:00 2001 From: DTB Date: Wed, 8 Nov 2023 18:31:48 -0700 Subject: [PATCH] don't assign customizeable variables if they're in the user's environment --- yt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/yt b/yt index d7e45f3..cb37d4c 100755 --- a/yt +++ b/yt @@ -20,10 +20,12 @@ set -e 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=' + +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