Created
July 15, 2023 01:00
-
-
Save PatheticMustan/4fa23d0a9b4f866569122d8d5cf3e065 to your computer and use it in GitHub Desktop.
hehehehe
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
const fs = require('fs'), | |
request = require('request'); | |
const download = (uri, filename, callback) => { | |
request.head(uri, (err, res, body) => { | |
request(uri).pipe(fs.createWriteStream(filename)).on('close', callback); | |
}); | |
}; | |
// this line was replaced | |
const imgList = `link\nlink\nlink` | |
function v(i) { | |
download(imgList[i], imgList[i].slice(-14), () => { | |
console.log(`${i+1}/2154 downloaded`); | |
if (i+1 !== 2154) v(i+1); | |
}); | |
} | |
v(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment