From 78601117e76efc45b1eccd19bbf4352f671a78b6 Mon Sep 17 00:00:00 2001 From: lhark Date: Fri, 22 Mar 2019 14:27:11 -0400 Subject: [PATCH] [cliplumber] Display useful error message in notification when youtube-dl fails --- cliplumber | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cliplumber b/cliplumber index 263bfab..05f1f44 100755 --- a/cliplumber +++ b/cliplumber @@ -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"