-
-
Save felipeluna/e20f21157ada8e0ec6699ae545c9c032 to your computer and use it in GitHub Desktop.
download mp3's from bandcamp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} | |
filename = ("0" + (index+1)).slice(-2) + ". " + track.title | |
commands.push('curl -o "' + filename + '.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