File size: 834 Bytes
79a42c2
 
 
 
 
 
 
6bc1af4
 
 
 
 
79a42c2
 
 
6bc1af4
 
 
 
 
 
79a42c2
 
 
6bc1af4
 
 
 
79a42c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const fs = require("fs");
let accounts = fs
  .readFileSync("./account", "utf8")
  .split("\n")
  .filter((a) => !a.includes("!"));
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}`);
    }
  }
})();