2019-07-05 08:03:08 +00:00
|
|
|
#!/bin/sh
|
|
|
|
dir=`for d in ~/Music/*;do
|
|
|
|
if [ -d "$d" ]
|
|
|
|
then
|
|
|
|
basename "$d"
|
|
|
|
fi
|
|
|
|
done | dmenu -i -l 10 -p 'Pick a directory'`
|
|
|
|
echo ~/Music/$dir
|
|
|
|
if [ -z "$dir" ]; then exit; fi
|
|
|
|
|
|
|
|
url=`echo '' | dmenu -p 'Enter a url'`
|
|
|
|
if [ -z "$url" ]; then exit; fi
|
|
|
|
|
|
|
|
# youtube-dl constantly breaks so --verbose is here for your pleasure
|
|
|
|
youtube-dl --extract-audio --verbose \
|
2019-05-15 08:51:58 +00:00
|
|
|
--audio-format mp3 \
|
2019-07-05 08:03:08 +00:00
|
|
|
-o "~/Music/$dir/%(title)s.%(ext)s" \
|
|
|
|
"$url"
|