Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download full discography. #150

Closed
arnauldb opened this issue Jul 20, 2018 · 15 comments
Closed

Download full discography. #150

arnauldb opened this issue Jul 20, 2018 · 15 comments
Assignees

Comments

@arnauldb
Copy link

Hello,

Is it possible to download a full discography? E.g, if I wish to download all albums in https://hotcasarecords.bandcamp.com/music

Thank you.

@Evolution0
Copy link
Collaborator

It is a feature I plan to add in the near future as a sort of final feature update.

@Evolution0 Evolution0 self-assigned this Aug 15, 2018
@silkyclouds
Copy link

I'd like to add one extra request here if possible. It would be great to generate a file (txt, whatever) and to monitor artists pages.

Then run bandcamp-dl in a screen, or run it as a service. or run it from cron.

Once launched, the txt file is processed. if anything new was posted on the followed artists page(s), it is automatically downloaded.

would automate the above process quite a bit.

@spelljammr
Copy link

I'd also like to see this. Having issues with the other scripts that try to accomplish this. Keep up the great work!

@alej0varas
Copy link

Meanwhile you can get all the album's URLs from an artist page with this JavaScript code. Run it in your browser console while in an artist page. Then put the lines in a file and call bandcamp-dl in a loop.

JavaScript code to get album/track URLs

var x = document.querySelectorAll("li.music-grid-item > a:nth-child(1)");
var i, text="";
for (i = 0; i < x.length; i++) {
  text += x[i] + "\n";
} 

Bash code to loop over file

 for i in $(cat download); do bandcamp-dl $i; done

@Mattwmaster58
Copy link

Mattwmaster58 commented Mar 5, 2019

@Evolution0 Any progress? I'd also use the feature and could add it but if you already have something started I'll wait.

@OpGWjzFVI
Copy link

It would be great just to have something like "youtube-dl -a URLS.txt" to run it on a file full of album URLs. I will often collect album URLs in a file while sampling, and then grab them all in one swoop. I like bcdl better than ytdl, but really wish it had this feature!

@p-vs-np
Copy link

p-vs-np commented Jun 21, 2019

@silkyclouds @alej0varas Great ideas. This batch script can be run on Windows Scheduler, etc.

@NeodarZ
Copy link

NeodarZ commented Jul 7, 2019

More simple solution, but only tested on Linux, I think It can work on other platform too but you maybe need some adjustments:

#!/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

EDIT: More specific sed rule.

@kovasap
Copy link

kovasap commented Jul 25, 2019

I'd be happy to try implementing this, but don't want to duplicate work. Anyone else who's started on this want to open a (even partial) PR?

@Evolution0 Evolution0 added this to the 0.0.9 milestone Aug 7, 2019
@Evolution0 Evolution0 removed this from the 0.0.9 milestone Jan 10, 2021
@Evolution0
Copy link
Collaborator

Evolution0 commented Jan 12, 2021

In progress, also adding wishlist support and possibly collections support but as I don't have any content on Bandcamp I have no way of really seeing what the html looks like for collections other than what the wishlist html suggests (Likely same exact html, just under the users profile URL)

Looks like I'll be making a few functions and generalizing others, upside is I should also be able to add in the feature to spit out just urls.

@Evolution0
Copy link
Collaborator

Progress has been made, I can now identify content type from the urls provided (collection, discography, wishlist, track, album) from here I can now fetch page data and send it to the right parsing function.

@kovasap
Copy link

kovasap commented Nov 1, 2021

Any update here?

@12yep
Copy link

12yep commented Nov 9, 2021

Another way, get all the album's urls with https://wiki.debian.org/Lynx
Need adjustments as your prefers

#!/bin/bash
##sudo apt instal -y lynx && sudo pip3 install bandcamp-downloader##
echo "Copy Bandacmp Url e.g https://ARTIST.bandcamp.com/music"
read url
lynx -dump -listonly -nonumbers $url | grep "bandcamp.com/album" > bandcamp-link.txt ; sleep 1
for album in $(cat bandcamp-link.txt); do (bandcamp-dl -r --template "%{artist} - %{album}/%{track} - %{title}" $album); done

@Evolution0 Evolution0 pinned this issue Dec 30, 2021
@RFGMM
Copy link

RFGMM commented Mar 7, 2023

massive-bandcamp-dl.sh

#! /bin/bash
listfilename=$(date +%F%H%M)
finalfilename=$(echo $RANDOM)
url=$1
if ! [[ $1 =~ https?://.*\.bandcamp\.com.* ]]; then
  echo "Use a valid bandcamp's URL..."
  else
wget  --convert-links $url -O /tmp/$listfilename.txt
cat /tmp/$listfilename.txt |  grep -e "/album" -e "/track/" |sed -n 's/.*href="\([^"]*\).*/\1/p' > /tmp/$finalfilename.txt
wc -l /tmp/$listfilename.txt
rm /tmp/$listfilename.txt
wc -l /tmp/$finalfilename.txt
LINES=$(cat /tmp/$finalfilename.txt)
for LINE in $LINES
do
    bc-dl $LINE
done
rm /tmp/$finalfilename.txt
fi

bancdamp-downloader.sh


#! /bin/bash
if ! [[ $1 =~ https?://.*\.bandcamp\.com.* ]]; then
  echo "Use a valid bandcamp's URL..."
  else
AAName=$(yt-dlp --get-filename --playlist-items 1 -o '%(artist)s-%(album)s' --output-na-placeholder  '' $1)
FixedAAName=${AAName// /-}
echo $FixedAAName
mkdir $FixedAAName
#yt-dlp -o "$FixedAAName/%(artist)s-%(album)s-%(playlist_index)s-%(track)s.%(ext)s" $1 
yt-dlp -o "$FixedAAName/%(playlist_index)s-%(track)s.%(ext)s" $1 
fi

@christatedavies
Copy link

Awesome. finally managed to download all of my purchased albums. thanks dudes.

@Evolution0 Evolution0 unpinned this issue Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests