playlists support fixed
This commit is contained in:
parent
0aa02524a3
commit
b6b45eace3
2
polybar
2
polybar
@ -1,3 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
sleep 5
|
sleep 3
|
||||||
polybar top > /dev/null
|
polybar top > /dev/null
|
||||||
|
16
ytdl
16
ytdl
@ -1,25 +1,25 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
dir=`for d in ~/Music/*;do
|
dir="`for d in ~/Music/*;do
|
||||||
if [ -d "$d" ]
|
if [ -d "$d" ]
|
||||||
then
|
then
|
||||||
basename "$d"
|
basename "$d"
|
||||||
fi
|
fi
|
||||||
done | dmenu -i -l 10 -p 'Pick a directory'`
|
done | dmenu -i -l 10 -p 'Installation location'`"
|
||||||
|
|
||||||
if [ -z "$dir" ]; then exit; fi
|
if [ -z "$dir" ]; then exit; fi
|
||||||
mkdir -p "~/Music/$dir"
|
mkdir -p "$HOME/Music/$dir"
|
||||||
|
|
||||||
url=`echo '' | dmenu -p 'Enter a url'`
|
url=`echo '' | dmenu -p 'Enter a url'`
|
||||||
if [ -z "$url" ]; then exit; fi
|
if [ -z "$url" ]; then exit; fi
|
||||||
|
|
||||||
# youtube-dl constantly breaks so --verbose is here for your pleasure
|
# youtube-dl constantly breaks so --verbose is here for your pleasure
|
||||||
cmd='youtube-dl --extract-audio --verbose --audio-format mp3'
|
cmd='youtube-dl --extract-audio --verbose --audio-format mp3 -o'
|
||||||
outplaylist="-o ~/Music/$dir/%(autonumber)02d $url"
|
outplaylist="$HOME/Music/${dir}/%(autonumber)02d - %(title)s.%(ext)s"
|
||||||
outsingle="-o ~/Music/$dir/%(title)s.%(ext)s $url"
|
outsingle="$HOME/Music/${dir}/%(title)s.%(ext)s"
|
||||||
|
|
||||||
if echo "$url" | grep -q '&list='; then
|
if echo "$url" | grep -q '&list='; then
|
||||||
$cmd $outplaylist
|
$cmd "$outplaylist" "$url"
|
||||||
else
|
else
|
||||||
$cmd $outsingle
|
$cmd "$outsingle" "$url"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user