Skip to content

Instantly share code, notes, and snippets.

@Avinash-Bhat
Forked from icodeforlove/bandcamp.js
Last active April 29, 2016 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Avinash-Bhat/a39446e5a9977bc6160e25fa70246b65 to your computer and use it in GitHub Desktop.
Save Avinash-Bhat/a39446e5a9977bc6160e25fa70246b65 to your computer and use it in GitHub Desktop.
download mp3's from bandcamp
var commands = [];
commands.push('mkdir "' + TralbumData.current.title + '"');
commands.push('cd "' + TralbumData.current.title + '"');
TralbumData.trackinfo.forEach(function (track, index) {
if (track.file) {
var href = track.file['mp3-128'];
if (href.startsWith("//")) {
href = "https:" + href
}
commands.push('curl -o "' + track.title + '.mp3" -L "' + href + '"&');
}
});
commands.push('cd ../');
console.log(commands.join('\n'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment