[cliplumber] Display useful error message in notification when youtube-dl fails

This commit is contained in:
lhark 2019-03-22 14:27:11 -04:00
parent b0acc283c3
commit 78601117e7

View file

@ -20,8 +20,8 @@ case "$choice" in
path="$HOME/mus/$(printf "%s" "$choice" | cut -d " " -f 2-)"
[ -d "$path" ] || mkdir -p "$path"
cd "$path" || exit
youtube-dl -x --audio-format mp3 --no-playlist -o "%(title)s.%(ext)s" "$clip" ||
notify-send "Error while downloading: $clip"
youtube-dl -x --audio-format mp3 --no-playlist -o "%(title)s.%(ext)s" "$clip" 2>&1 | grep 'ERROR:' | xargs -n1 -d "\n" notify-send
#notify-send "Error while downloading: $clip"
;;
"play")
mpv --ytdl-format='bestvideo[height<=?1080]+bestaudio/best' "$clip"