-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqndl
executable file
·28 lines (27 loc) · 1.29 KB
/
qndl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
# change "tsp" to "ts" on VoidLinux
[ -z "$1" ] && exit
dldir=$HOME/Downloads
handler(){ # little handler function for download only (maybe add urls intead of formats?)
case "$1" in
*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*)
ts -nf youtube-dl "$1" --add-metadata -ic --exec "mv {} $HOME/Downloads" ;;
*mkv|*webm|*mp4|*hooktube.com*|*bitchute.com*|*videos.lukesmith.xyz*)
ts -nf curl -sL "$1" > "$dldir/$(basename "$1" | sed "s/.*\///;s/%20/ /g")" ;;
*png|*jpg|*jpe|*jpeg|*JPG|*gif|*.webp)
ts -nf curl -sL "$1" > "$dldir/$(basename "$1" | sed "s/.*\///;s/%20/ /g")" ;;
*pdf|*cbz|*cbr)
ts -nf curl -sL "$1" > "$dldir/$(basename "$1" | sed "s/.*\///;s/%20/ /g")" ;;
*mp3|*flac|*opus|*mp3?source*)
ts -nf curl -LO "$1" > "$dldir/$(basename "$1" | sed "s/.*\///;s/%20/ /g")" ;;
*)
ts -nf curl -LO "$1" > "$dldir/$(basename "$1" | sed "s/.*\///;s/%20/ /g")" ;;
esac
}
[ -n "$2" ] && case "$2" in
audio)
notify-send "⏳ Downloading audio..." "<i><u>'$(basename "$1")'</i></u>..."
ts -nf youtube-dl "$1" --add-metadata -icxf bestaudio/best --exec "mv {} $HOME/Downloads" ;;
esac
[ -z "$2" ] && notify-send "⏳ Downloading..." "<i><u>'$(basename "$1")'</i></u>..." && handler "$1" >/dev/null 2>&1
notify-send "Qndl" "👍 Download Finished⌛, Enjoy! 🍵\n<i><u>'$(basename "$1")'</i></u>"