Browse Source

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

master
lhark 7 years ago
parent
commit
78601117e7
  1. 4
      cliplumber

4
cliplumber

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

Loading…
Cancel
Save