3cd83ed450
changed output ids to match new setup
30 lines
750 B
Bash
Executable File
30 lines
750 B
Bash
Executable File
#!/bin/sh
|
|
|
|
dir="`for d in ~/Music/*;do
|
|
if [ -d "$d" ]
|
|
then
|
|
basename "$d"
|
|
fi
|
|
done | dmenu -i -l 10 -p 'Installation location'`"
|
|
|
|
if [ -z "$dir" ]; then exit; fi
|
|
mkdir -p "$HOME/Music/$dir"
|
|
|
|
url=`echo '' | dmenu -p 'Enter a url'`
|
|
if [ -z "$url" ]; then exit; fi
|
|
|
|
# youtube-dl constantly breaks so --verbose is here for your pleasure
|
|
cmd='youtube-dl --extract-audio --verbose --audio-format mp3'
|
|
outplaylist="$HOME/Music/${dir}/%(autonumber)02d - %(title)s.%(ext)s"
|
|
outsingle="$HOME/Music/${dir}/%(title)s.%(ext)s"
|
|
|
|
# youtube playlists
|
|
if echo "$url" | grep -q '&list=\|?list'; then
|
|
$cmd -i -o "$outplaylist" "$url"
|
|
# soundcloud sets
|
|
elif echo "$url" | grep -q '/sets/'; then
|
|
$cmd -i -o "$outplaylist" "$url"
|
|
else
|
|
$cmd -o "$outsingle" "$url"
|
|
fi
|