voidrice/.local/bin/qndl

13 lines
365 B
Text
Raw Permalink Normal View History

#!/bin/sh
2019-01-20 22:39:03 +00:00
# $1 is a url; $2 is a command
[ -z "$1" ] && exit
base="$(basename "$1")"
notify-send "⏳ Queuing $base..."
2019-01-20 22:39:03 +00:00
cmd="$2"
[ -z "$cmd" ] && cmd="yt-dlp --embed-metadata -ic"
2020-07-17 17:18:52 +00:00
idnum="$(tsp $cmd "$1")"
2019-01-20 22:39:03 +00:00
realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")"
tsp -D "$idnum" mv "$base" "$realname"
tsp -D "$idnum" notify-send "👍 $realname done."