代码拉取完成,页面将自动刷新
// download data from pubgmap.io
const axios = require('axios')
const fs = require('fs')
const dataMap = {
'erangel-info.json': 'https://api.pubgmap.io/maps/erangel',
'erangel-garages.json': 'https://api.pubgmap.io/maps/erangel/layers/garages',
'erangel-vehicle.json': 'https://api.pubgmap.io/maps/erangel/layers/vehicle_spawns',
'erangel-boat.json': 'https://api.pubgmap.io/maps/erangel/layers/boat_spawns',
'erangel-loot.json': 'https://api.pubgmap.io/maps/erangel/layers/loot_heatmap',
'miramar-info.json': 'https://api.pubgmap.io/maps/miramar',
'miramar-vehicle.json': 'https://api.pubgmap.io/maps/miramar/layers/vehicle_spawns',
'miramar-offroad.json': 'https://api.pubgmap.io/maps/miramar/layers/offroad',
'miramar-boat.json': 'https://api.pubgmap.io/maps/miramar/layers/boat_spawns',
'miramar-loot.json': 'https://api.pubgmap.io/maps/miramar/layers/loot_heatmap',
}
const fileBase = './static/data'
async function main () {
for (const key in dataMap) {
process.stdout.write(`Downloading ${dataMap[key]} to ${fileBase}/${key} `)
let response = null
try {
response = await axios.get(dataMap[key], { responseType: 'arraybuffer' })
fs.writeFileSync(`${fileBase}/${key}`, response.data)
console.log(' - OK!')
} catch (err) {
console.log(' - failed!', err.message)
}
}
}
main().catch(err => {
console.log('unexpected error', err)
cleanup.then(() => {
process.exit(2)
})
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。