Mobilegends Stalker
// Powered by FazzCodeID
// Channel: https://whatsapp.com/channel/0029Vb66VpnA2pLGOYBeuq0S
const axios = require('axios');
const { wrapper } = require('axios-cookiejar-support');
const { CookieJar } = require('tough-cookie');
const BASE_URL = 'https://sosigame.com';
const LOOKUP_URL = `${BASE_URL}/cek-id-ml/lookup`;
const PAGE_URL = `${BASE_URL}/cek-id-ml`;
const UA =
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 ' +
'(KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
const jar = new CookieJar();
const client = wrapper(
axios.create({
jar,
withCredentials: true,
timeout: 20000,
headers: {
'User-Agent': UA,
'Accept-Language': 'id-ID,id;q=0.9,en;q=0.8',
},
})
);
async function getCsrfToken() {
const res = await client.get(PAGE_URL, {
headers: {
Accept:
'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
},
});
const html = res.data;
const match =
html.match(/name="csrf-token"\s+content="([^"]+)"/i) ||
html.match(/<meta[^>]+name=["']csrf-token["'][^>]+content=["']([^"']+)["']/i) ||
html.match(/X-CSRF-TOKEN['"]\s*[:=]\s*['"]([^'"]+)['"]/i);
if (!match) throw new Error('CSRF token tidak ditemukan di HTML');
return match[1];
}
async function lookupML(userId, zoneId) {
const token = await getCsrfToken();
const { data } = await client.post(
LOOKUP_URL,
{ user_id: String(userId), zone_id: String(zoneId) },
{
headers: {
'Content-Type': 'application/json',
Accept: 'application/json, text/plain, */*',
'X-CSRF-TOKEN': token,
'X-Requested-With': 'XMLHttpRequest',
Origin: BASE_URL,
Referer: PAGE_URL,
},
}
);
return data;
}
(async () => {
const userId = process.argv[2] || '283671914';
const zoneId = process.argv[3] || '8206';
try {
const result = await lookupML(userId, zoneId);
const output = {
success: result.success === true,
username: result.username || null,
userId: result.user_id || userId,
zoneId: result.zone_id || zoneId,
region: result.region || null,
};
console.log(JSON.stringify(output, null, 2));
} catch (err) {
const status = err.response?.status;
let msg = err.message;
if (status === 419) msg = 'CSRF token expired / invalid (419)';
else if (status === 403) msg = 'Diblokir Cloudflare / forbidden (403)';
else if (status === 429) msg = 'Rate limit / terlalu banyak request (429)';
console.log(
JSON.stringify(
{
success: false,
username: null,
userId,
zoneId,
region: null,
error: msg,
},
null,
2
)
);
process.exit(1);
}
})();
Discussion
Thread
Belum ada komentarJadilah yang pertama membuka diskusi.