Bandcamp download mp3s

Shows download links for the preview files on bandcamp albums

< Feedback on Bandcamp download mp3s

Review: Good - script works

§
Posted: 2017/01/07

Gets the job done.

Nice dense code with simple output.

Nitpicks:

DownThemAll does not see links as having MP3 format, so files have to be saved individually.

Displays links behind main page content, so they're half-hidden at narrow resolutions (e.g. tallscreen).

Ideally links would be displayed in-band with the page content - maybe on-hover like the "buy track" links? - and would make automatic album saving trivial.

Overall, it serves its purpose well.

cuziAuthor
§
Posted: 2017/01/07

Thanks for your comment!

Actually, my first idea was to make it automatically download a Zip-file with all the mp3s (a little bit like this script does it with images). However, back in 2012 when I wrote the first version of this script, Firefox/Javascript could not handle zipping these big files. So I discarded the idea.

I am not sure whether we can do anything about DownThemAll recognizing the links. It probably examines the file extension, which does not exist here.

Why did I not add the links to the page content? Bandcamp has a strange layout ;) Try the following code, just copy it at the end of the current script or replace the whole code. It does add the links to the hover "buy track" thingy. Unfortunately, it breaks the layout.

window.setTimeout(function() {
  if(TralbumData && TralbumData.hasAudio && !TralbumData.freeDownloadPage && TralbumData.trackinfo) {
    var i = 0;
    var hoverdiv = document.querySelectorAll(".download-col div");
    TralbumData.trackinfo.forEach(function(t) {
      for (var prop in t.file) {
        var mp3 = t.file[prop].replace(/^\/\//,"http://");
        var a = document.createElement("a");
        a.href = mp3;
        a.appendChild(document.createTextNode(prop));
        hoverdiv[i++].appendChild(a);
        break;
      }
    });
  }
},200);

Post reply

Sign in to post a reply.