From cfba8a0f6dce64a77aa5fff88ba43a104a3d2e77 Mon Sep 17 00:00:00 2001 From: Brett Phillips Date: Mon, 9 Jan 2017 11:51:28 -0600 Subject: [PATCH] Added support for artists or track title with commas, remove slash when it exists in artists or track names because most OS does not support a file name with a slash and added cURL command to ignore content length since some downloads would end prematurely because of the content length. --- download.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/download.sh b/download.sh index e78973d..6f88f5b 100755 --- a/download.sh +++ b/download.sh @@ -30,11 +30,12 @@ declare -i lines=$(wc -l < $playlist) declare -i songs=($lines-1)/2 for ((song = 1; song <= $songs; song++)); do - songtitle="$(awk "NR==$song*2 {print}" $playlist | cut -d',' -f2)" + songtitle="$(awk "NR==$song*2 {print}" $playlist | cut -d',' -f2-)" + songtitle=${songtitle//\//-} echo -e "$song/$songs\tDownloading $songtitle" songlink="$(awk "NR==$song*2+1 {print}" $playlist)" - curl -o "$outputdir/$song $songtitle.mp3" -s $songlink + curl -o "$outputdir/$song $songtitle.mp3" -s $songlink --ignore-content-length done echo -e "\nAll songs downloaded."