Spaces:
Running
Running
File size: 756 Bytes
6bc1af4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
const fs = require("fs")
let accounts = fs.readFileSync('./account', 'utf8').split("\n");
let custom = process.argv.slice(2)
let _accounts = custom?.length > 0 ? custom : accounts
console.log(_accounts);
(async () => {
for (let i of _accounts) {
try {
const url = `https://${i}-cors.hf.space/proxy?url=${encodeURIComponent('https://ipwho.is')}`;
const res = await fetch(url);
if (!res.ok) throw new Error(`Status ${res.status}`);
const json = await res.json();
if (!json.success) throw new Error(json.message || "Unknown error");
console.log(`[${i}] IP: ${json.ip} | Lokasi: ${json.city}, ${json.region}, ${json.country}`);
} catch (err) {
console.error(`[${i}] Gagal: ${err.message}`);
}
}
})() |