Last active
December 31, 2015 03:29
-
-
Save tamebadger/7927790 to your computer and use it in GitHub Desktop.
My little JavaScript script to download mp3 files (Wackhead's Pranks)
This file contains 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 allLinks = document.querySelectorAll('a[href$=".mp3"]'); | |
var links = []; | |
for (var i = 0; i < allLinks.length; i++) { | |
links[i] = allLinks[i].getAttribute('href'); | |
} | |
//just iterate over either of these when downloading all links | |
//Opens new windows and starts download = Unwanted | |
//window.open(links[0]) | |
//Starts download in current window | |
window.location.assign(links[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment