aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpystardust <notpiestardust@gmail.com>2021-03-03 13:09:19 +0530
committerpystardust <notpiestardust@gmail.com>2021-03-03 13:09:19 +0530
commite5a46fd4ed410236c0f303627581cf8a2c36e008 (patch)
tree86349a123d759acdc58808ecd4adebd53c78b17a
parent633937fad48a46f0401c9b4ae26f219a055d9a17 (diff)
downloadytfzf-e5a46fd4ed410236c0f303627581cf8a2c36e008.tar.gz
Removed hard coding mpv as dep, and added player error for video failure
-rwxr-xr-xytfzf5
1 files changed, 3 insertions, 2 deletions
diff --git a/ytfzf b/ytfzf
index 34fbf34..7ef3785 100755
--- a/ytfzf
+++ b/ytfzf
@@ -49,7 +49,8 @@ dep_ck () {
command -v "$dep" 1>/dev/null || { printf "$dep not found. Please install it.\n" ; exit 2; }
done
}
-dep_ck "jq" "youtube-dl" "mpv";
+dep_ck "jq" "youtube-dl";
+[ "$YTFZF_PLAYER" = "mpv" ] && dep_ck "mpv"
############################
@@ -373,7 +374,7 @@ play_url () {
[ 4 -eq $? ] || eval "$YTFZF_PLAYER" "\"$(printf "$urls" | tr '\n' '\t' | sed 's_\t_" "_g' )\""
# Ctr-C in MPV results in a return code of 4
} || {
- printf "\033[31mERROR[#03]: Couldn't play the video/audio using the current player.\n\tTry updating youtube-dl\033[000m\n"; errinfo ; save_before_exit ; exit 2;
+ printf "\033[31mERROR[#03]: Couldn't play the video/audio using the current player: ${YTFZF_PLAYER}\n\t\033[000mTry updating youtube-dl\n"; errinfo ; save_before_exit ; exit 2;
}
}
save_before_exit () {
Un proyecto texto-plano.xyz