From b6b45eace349d0f783c926857618a9029859dadc Mon Sep 17 00:00:00 2001 From: shockrahwow Date: Mon, 23 Sep 2019 19:22:50 -0700 Subject: [PATCH] playlists support fixed --- polybar | 2 +- ytdl | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/polybar b/polybar index 1b81e62..1bd0dd6 100644 --- a/polybar +++ b/polybar @@ -1,3 +1,3 @@ #!/bin/sh -sleep 5 +sleep 3 polybar top > /dev/null diff --git a/ytdl b/ytdl index 542fb02..324561d 100755 --- a/ytdl +++ b/ytdl @@ -1,25 +1,25 @@ #!/bin/sh -dir=`for d in ~/Music/*;do +dir="`for d in ~/Music/*;do if [ -d "$d" ] then basename "$d" fi -done | dmenu -i -l 10 -p 'Pick a directory'` +done | dmenu -i -l 10 -p 'Installation location'`" if [ -z "$dir" ]; then exit; fi -mkdir -p "~/Music/$dir" +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="-o ~/Music/$dir/%(autonumber)02d $url" -outsingle="-o ~/Music/$dir/%(title)s.%(ext)s $url" +cmd='youtube-dl --extract-audio --verbose --audio-format mp3 -o' +outplaylist="$HOME/Music/${dir}/%(autonumber)02d - %(title)s.%(ext)s" +outsingle="$HOME/Music/${dir}/%(title)s.%(ext)s" if echo "$url" | grep -q '&list='; then - $cmd $outplaylist + $cmd "$outplaylist" "$url" else - $cmd $outsingle + $cmd "$outsingle" "$url" fi