BL
Size: a a a
BL
BL
GK
TS
GK
TS
TS
A
const Fs = require('fs')
const Path = require('path')
const Axios = require('axios')
const images=['https://cdn.softswiss.net/i/s3/evoplay/JourneytotheWest.png','https://cdn.softswiss.net/i/s3/tomhorn/DiamondHill.png'];
async function downloadImage (_url) {
const url = _url
const path = Path.resolve(__dirname, 'images/', "BTN_SSW_"+url.split("/")[url.split("/").length-1])
const writer = Fs.createWriteStream(path)
let resp = await Axios.get(url, { responseType: 'stream' });
resp.data.pipe(writer);
return new Promise((resolve, reject) => {
writer.on('finish', resolve)
writer.on('error', reject)
})
}
async function main(_images)
{ for await (let img of _images) {
downloadImage(img).catch((e)=>{
console.log("not load: "+img); // "oh, no!"
})
}
}
main(images);
NK
Ш
AA
Ш
Ш
Т
V
V
Т
AB
MS
MS