updated to posix compliance

This commit is contained in:
shockrahwow 2019-07-05 01:03:08 -07:00
parent 8d911e1b37
commit 4803d9bf78

24
ytdl
View File

@ -1,8 +1,18 @@
#!/bin/bash #!/bin/sh
dir=$(find ~/Music/ -maxdepth 1 -type d | dmenu -i -p "Pick a directory") dir=`for d in ~/Music/*;do
url="$(echo '' | dmenu -p 'Enter a url')" if [ -d "$d" ]
[ -z "$url" ] && exit 0 then
youtube-dl --extract-audio \ 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 \
--audio-format mp3 \ --audio-format mp3 \
-o "$dir/%(title)s.%(ext)s" \ -o "~/Music/$dir/%(title)s.%(ext)s" \
$url "$url"