blob: 9c7c658dff98f230275863fd18a80fb6d106518f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/bin/bash
if [ -z "$1" ]; then
echo "usage:"
echo " $0 <url>"
echo ""
echo "<url> 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
|