Mengambil informasi data profile user tiktok menggunakan username
/**
* Judul : TikTok Stalker
* Base URL : https://www.tiktok.com
* Author : Cx99 - t.me/exploit99
* Deskripsi : Mengambil informasi data profile user tiktok menggunakan username
* Channel : https://whatsapp.com/channel/0029VbCSF8sA89MopCVOYW06
*/
const axios = require('axios');
const cheerio = require('cheerio');
async function stalkTikTok(username) {
username = username.replace(/^@/, '');
const url = `https://www.tiktok.com/@${username}`;
const userAgent = 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Mobile Safari/537.36';
try {
const response = await axios.get(url, {
headers: {
'User-Agent': userAgent,
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
}
});
const $ = cheerio.load(response.data);
const scriptData = $('#__UNIVERSAL_DATA_FOR_REHYDRATION__').text();
if (!scriptData) {
return {
status: false,
message: "Gagal memproses data: Data rehydration tidak ditemukan (mungkin terblokir WAF)."
};
}
const data = JSON.parse(scriptData);
if (!data['__DEFAULT_SCOPE__'] || !data['__DEFAULT_SCOPE__']['webapp.user-detail']) {
return {
status: false,
message: "Data user tidak ditemukan. Pastikan username TikTok yang dimasukkan benar."
};
}
const userDetail = data['__DEFAULT_SCOPE__']['webapp.user-detail'];
if (userDetail.statusCode !== 0 || !userDetail.userInfo) {
return {
status: false,
message: "User tidak ditemukan atau akun di-private."
};
}
const user = userDetail.userInfo.user;
const stats = userDetail.userInfo.stats;
return {
status: true,
data: {
username: user.uniqueId,
nickname: user.nickname,
avatar: user.avatarLarger || user.avatarMedium,
signature: user.signature,
verified: user.verified,
stats: {
followers: stats.followerCount,
following: stats.followingCount,
video_upload: stats.videoCount,
likes: stats.heartCount,
friends: stats.friendCount
},
profile_url: url
}
};
} catch (error) {
return {
status: false,
message: `Gagal memproses data: ${error.message}`
};
}
}
module.exports = stalkTikTok;
if (require.main === module) {
const args = process.argv.slice(2);
if (args.length === 0) {
console.log("? Penggunaan: node stalktt.js <username>");
console.log("? Contoh: node stalktt.js asololepisanwan");
process.exit(1);
}
const username = args[0];
stalkTikTok(username)
.then(res => console.log(JSON.stringify(res, null, 2)))
.catch(err => console.error(err));
}