Skip to content

Instantly share code, notes, and snippets.

@yuanoook
Created June 17, 2017 17:04
Show Gist options
  • Save yuanoook/d7e8dcb04b120cc10933729ec8a7a855 to your computer and use it in GitHub Desktop.
Save yuanoook/d7e8dcb04b120cc10933729ec8a7a855 to your computer and use it in GitHub Desktop.
function download(url) {
var a = document.createElement('a');
a.setAttribute('href', url);
a.setAttribute('download', '');
a.click();
}
var indexs = [];
for(let i=1; i<=61; i++) indexs.push(i);
indexs.forEach(i => {
var long2i = i<10 ? ('0' + i) : i;
var long3i = i<10 ? ('00' + i) : ('0' + i);
setTimeout(() => {
[
`http://www.rong-chang.com/usalife/audio/t/usalife${ long2i }a.mp3`,
`http://www.rong-chang.com/usalife/audio/c/usalife${ long2i }b.mp3`,
`http://www.rong-chang.com/usalife/a/usalife${ long3i }a.htm`,
`http://www.rong-chang.com/usalife/b/usalife${ long3i }b.htm`
].forEach((url, index) => {
index ? setTimeout(() => download(url),index*3000) : download(url);
});
},(i-1)*10000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment