2019-08-18 16:28:11 +00:00
|
|
|
#!/usr/bin/env sh
|
2019-01-20 22:39:03 +00:00
|
|
|
# $1 is a url; $2 is a command
|
|
|
|
[ -z "$1" ] && exit
|
|
|
|
base="$(basename "$1")"
|
2019-02-22 21:39:58 +00:00
|
|
|
notify-send "⏳ Queuing $base..."
|
2019-01-20 22:39:03 +00:00
|
|
|
cmd="$2"
|
|
|
|
[ -z "$cmd" ] && cmd="youtube-dl --add-metadata"
|
|
|
|
idnum="$(tsp $cmd "$1")"
|
|
|
|
realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")"
|
|
|
|
tsp -D "$idnum" mv "$base" "$realname"
|
2019-02-22 21:39:58 +00:00
|
|
|
tsp -D "$idnum" notify-send "👍 $realname done."
|