Add bandcamp_download_all
This commit is contained in:
31
bandcamp_download_all
Executable file
31
bandcamp_download_all
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
source bashcols.inc
|
||||
|
||||
html=$1
|
||||
output=${2:-.}
|
||||
|
||||
links=$(tidy 2>/dev/null "$html" | grep -oE 'https://p4\.bcbits.com/download/.*>D' | sed 's/">D$//')
|
||||
|
||||
cyan echo "Parsed links:"
|
||||
echo "$links"
|
||||
echo
|
||||
read -p "Continue? [Y/n] " CHOICE
|
||||
if [[ -z $CHOICE || $CHOICE =~ ^[yY] ]]; then
|
||||
while read -r link; do
|
||||
if [[ -z $link ]]; then
|
||||
continue
|
||||
fi
|
||||
if grep -F "/album/" <<<"$link"; then
|
||||
ext=".zip"
|
||||
else
|
||||
ext=".flac"
|
||||
fi
|
||||
name="$(cut -d'/' -f6 <<<"$link")${ext}"
|
||||
cyan echo "Downloading: ${link} => ${output}/${name}"
|
||||
wget "${link}" -O "${output}/${name}"
|
||||
done<<<"$links"
|
||||
else
|
||||
echo "Aborting"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user