Mengambil informasi data profile user Threads
/**
* Judul : Threads Stalker
* Base URL : https://www.threads.net
* Author : Cx99 - t.me/exploit99
* Deskripsi : Mengambil informasi data profile user Threads
* Channel : https://whatsapp.com/channel/0029VbCSF8sA89MopCVOYW06
*/
const axios = require('axios');
const cheerio = require('cheerio');
async function stalkThreads(username) {
username = username.replace(/^@/, '');
const url = `https://www.threads.net/@${username}`;
// Headers lengkap untuk bypass blokir dari server
const headers = {
"authority": "www.threads.net",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
"accept-language": "en-US,en;q=0.9",
"sec-ch-ua": "\"Not.A/Brand\";v=\"8\", \"Chromium\";v=\"114\", \"Google Chrome\";v=\"114\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"Windows\"",
"sec-fetch-dest": "document",
"sec-fetch-mode": "navigate",
"sec-fetch-site": "none",
"sec-fetch-user": "?1",
"upgrade-insecure-requests": "1",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
};
try {
const response = await axios.get(url, { headers });
const html = response.data;
const $ = cheerio.load(html);
let userData = null;
$('script[type="application/json"]').each((i, el) => {
const text = $(el).html();
// Data profile Threads tersimpan di script dengan follower_count
if (text && text.includes('follower_count')) {
try {
// Ekstraksi data menggunakan regex karena JSON aslinya sangat besar (Relay cache)
const usernameMatch = text.match(/"username":"([^"]+)"/);
const pkMatch = text.match(/"pk":"([^"]+)"/);
const hdPpMatch = text.match(/"hd_profile_pic_version":\{"url":"([^"]+)"/);
const ppMatch = text.match(/"profile_pic_url":"([^"]+)"/);
const nameMatch = text.match(/"full_name":"([^"]*)"/);
const followersMatch = text.match(/"follower_count":(\d+)/);
const bioMatch = text.match(/"biography":("(?:[^"\\]|\\.)*")/);
const verifiedMatch = text.match(/"is_verified":(true|false)/);
if (usernameMatch) {
let bio = "";
if (bioMatch) {
try {
bio = JSON.parse(bioMatch[1]);
} catch(e) {
bio = bioMatch[1];
}
}
let avatar = hdPpMatch ? hdPpMatch[1] : (ppMatch ? ppMatch[1] : "");
try { avatar = JSON.parse(`"${avatar}"`); } catch(e) {}
userData = {
username: usernameMatch[1],
id: pkMatch ? pkMatch[1] : null,
full_name: nameMatch ? JSON.parse(`"${nameMatch[1]}"`) : null,
profile_pic: avatar,
followers: followersMatch ? parseInt(followersMatch[1]) : 0,
biography: bio,
is_verified: verifiedMatch ? verifiedMatch[1] === 'true' : false,
profile_url: url
};
}
} catch (e) {
// Abaikan error parsing per chunk
}
}
});
if (!userData) {
return {
status: false,
message: "Data user tidak ditemukan. Pastikan username valid."
};
}
return {
status: true,
data: userData
};
} catch (error) {
return {
status: false,
message: `Gagal memproses data: ${error.message}`
};
}
}
module.exports = stalkThreads;
if (require.main === module) {
const args = process.argv.slice(2);
if (args.length === 0) {
console.log("? Penggunaan: node stalkthreads.js <username>");
console.log("? Contoh: node stalkthreads.js clarissadaily.ig");
process.exit(1);
}
const username = args[0];
stalkThreads(username)
.then(res => console.log(JSON.stringify(res, null, 2)))
.catch(err => console.error(err));
}