Created
June 17, 2017 17:04
-
-
Save yuanoook/d7e8dcb04b120cc10933729ec8a7a855 to your computer and use it in GitHub Desktop.
Download inbrowser http://www.rong-chang.com/usalife/a/usalife001a.htm
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
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