diff options
author | pystardust <notpiestardust@gmail.com> | 2021-03-03 13:11:50 +0530 |
---|---|---|
committer | pystardust <notpiestardust@gmail.com> | 2021-03-03 13:11:50 +0530 |
commit | adbf63a736acf4c3ad5c7f013f4a627a5090358b (patch) | |
tree | 86349a123d759acdc58808ecd4adebd53c78b17a | |
parent | 8738f16ff5f35dd71038a00fe1552cf09056cd78 (diff) | |
parent | e5a46fd4ed410236c0f303627581cf8a2c36e008 (diff) | |
download | ytfzf-adbf63a736acf4c3ad5c7f013f4a627a5090358b.tar.gz |
Merge branch 'cybarspace-patch-3'
Removing hard dep form mpv
Error message when the video couldn't be played using the given player
-rwxr-xr-x | ytfzf | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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" "$YTFZF_PLAYER"; +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 () { |