[cliplumber] Add optional download folder, failure notif
This commit is contained in:
parent
fc5456dc78
commit
ae43b0bc90
1 changed files with 8 additions and 4 deletions
12
cliplumber
12
cliplumber
|
@ -15,9 +15,13 @@ case "$choice" in
|
||||||
"qr")
|
"qr")
|
||||||
printf "%s" "$clip" | qrencode -o - | feh -. -Z --geometry 400x400 -
|
printf "%s" "$clip" | qrencode -o - | feh -. -Z --geometry 400x400 -
|
||||||
;;
|
;;
|
||||||
"download")
|
# Download supports optional folder target
|
||||||
cd ~/mus || exit
|
"download"*)
|
||||||
youtube-dl -x --audio-format mp3 --no-playlist -o "%(title)s.%(ext)s" "$clip"
|
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"
|
||||||
;;
|
;;
|
||||||
"play")
|
"play")
|
||||||
mpv --ytdl-format='bestvideo[height<=?1080]+bestaudio/best' "$clip"
|
mpv --ytdl-format='bestvideo[height<=?1080]+bestaudio/best' "$clip"
|
||||||
|
@ -26,6 +30,6 @@ case "$choice" in
|
||||||
st -e mpv --ytdl-format=bestaudio ytdl://ytsearch:"$clip"
|
st -e mpv --ytdl-format=bestaudio ytdl://ytsearch:"$clip"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "Nope\n"
|
printf 'Nope\n'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Reference in a new issue