From c3caba049861149611be6de5059ef2801bdc3916 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sun, 7 Jul 2019 08:25:51 +0200 Subject: Initial commit --- bandcamp-dl.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 bandcamp-dl.sh (limited to 'bandcamp-dl.sh') diff --git a/bandcamp-dl.sh b/bandcamp-dl.sh new file mode 100755 index 0000000..b79c43d --- /dev/null +++ b/bandcamp-dl.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +if [ -z "$1" ]; then + echo "usage:" + echo " $0 " + echo "" + echo " can be domain.tld or domaine.tld/music" + exit +fi + +base=$(echo $1 | sed -e "s/\/$//") + +urls=$(curl $base -o /tmp/bandcamp_out &> /dev/null ; cat /tmp/bandcamp_out | grep "href=\"/album" | cut -d"\"" -f2) + +base=$(echo $base | sed -e "s/\/music//") + +for url in $urls; do + echo "Downloading $(echo $url | sed -e "s/^\/album\///g") album..." + bandcamp-dl $base$url + if [ $? -ne 0 ]; then + echo "Are you sure that $base$url is a valid album url?" + exit + fi +done -- cgit v1.2.1