Stalker Tiktok
JavaScriptPublicby zx-apiOct 5, 2026, 10:14 AMExpires: Never165 views
1/**
2 * Credit By Zx
3 * Sumber Kode: https://whatsapp.com/channel/0029VbDLqe7EquiSF4STU13o
4 * Note: Kalau Mau Di sher Lagi Minimal Credit atau sumber jangan di hapus dong
5 * Website React WhatsApp Gratis:
6 * https://react.v1.zfile.web.id/
7 */
8
9/**
10
11Yang Mau Beli Akun Netflix, Top-Up game, Sunt1k S0Smed
12Bisa Ke Zix Store.
13
14 https://zixstore.kiospremium.site/
15
16Terimakasih ๐๐
17*/
18
19/**
20 * Stalker Tiktok
21 * Source: https://ttviewer.net/
22 *
23 * Ngambil Informasi Profile Tiktok Target
24 * Dan Ngambil Top Video atau foto postingan target
25 */
26
27const BASE_URL = "https://ttviewer.net";
28
29const DEFAULT_HEADERS = {
30 "Accept": "application/json, text/plain, */*",
31 "Content-Type": "application/json",
32 "User-Agent":
33 "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/152.0.0.0 Mobile Safari/537.36",
34 "Referer": "https://ttviewer.net/",
35};
36
37const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
38
39async function requestTtviewer(path, payload, { timeoutMs = 20000 } = {}) {
40 const url = `${BASE_URL}${path}`;
41
42 const res = await fetch(url, {
43 method: "POST",
44 headers: DEFAULT_HEADERS,
45 body: JSON.stringify(payload),
46 signal: AbortSignal.timeout(timeoutMs),
47 });
48
49 if (!res.ok) {
50 throw new Error(`HTTP ${res.status} ${res.statusText} - ${url}`);
51 }
52
53 const json = await res.json().catch(() => null);
54
55 if (!json) {
56 throw new Error("Response bukan JSON valid.");
57 }
58
59 if (json.code !== 0) {
60 throw new Error(json.msg || `API error code: ${json.code}`);
61 }
62
63 return json;
64}
65
66function normalizeVideo(video) {
67 return {
68 id: video.video_id || video.aweme_id || null,
69 title: video.title || "",
70 region: video.region || null,
71 created_at: video.create_time
72 ? new Date(video.create_time * 1000).toISOString()
73 : null,
74 stats: {
75 views: video.play_count ?? 0,
76 likes: video.digg_count ?? 0,
77 comments: video.comment_count ?? 0,
78 shares: video.share_count ?? 0,
79 downloads: video.download_count ?? 0,
80 collects: video.collect_count ?? 0,
81 },
82 media: {
83 type: Array.isArray(video.images) && video.images.length > 0
84 ? "photo"
85 : "video",
86 cover: video.cover || null,
87 images: video.images || [],
88 play: video.play || null,
89 duration: video.duration || 0,
90 },
91 music: video.music_info
92 ? {
93 id: video.music_info.id || null,
94 title: video.music_info.title || null,
95 author: video.music_info.author || null,
96 play: video.music_info.play || null,
97 }
98 : null,
99 is_ad: video.is_ad || false,
100 };
101}
102
103async function stalkertiktok(username, options = {}) {
104 const {
105 includeVideos = true,
106 count = 6,
107 pages = 1,
108 delayMs = 800,
109 } = options;
110
111 const unique_id = String(username || "")
112 .trim()
113 .replace(/^@/, "");
114
115 if (!unique_id) {
116 throw new Error("Username TikTok tidak boleh kosong.");
117 }
118
119 const profileResponse = await requestTtviewer(
120 "/api/tiktok/get-profile",
121 { unique_id }
122 );
123
124 const user = profileResponse?.data?.user || {};
125 const stats = profileResponse?.data?.stats || {};
126
127 const result = {
128 username: user.uniqueId || unique_id,
129 nickname: user.nickname || null,
130 signature: user.signature || null,
131 verified: user.verified || false,
132 privateAccount: user.privateAccount || false,
133 secUid: user.secUid || null,
134 id: user.id || null,
135 createTime: user.createTime
136 ? new Date(user.createTime * 1000).toISOString()
137 : null,
138 avatar: {
139 thumb: user.avatarThumb || null,
140 medium: user.avatarMedium || null,
141 larger: user.avatarLarger || null,
142 },
143 stats: {
144 following: stats.followingCount ?? 0,
145 followers: stats.followerCount ?? 0,
146 hearts: stats.heartCount ?? 0,
147 videos: stats.videoCount ?? 0,
148 diggs: stats.diggCount ?? 0,
149 },
150 };
151
152 if (!includeVideos) {
153 return result;
154 }
155
156 const videos = [];
157 let cursor = 0;
158 let hasMore = true;
159
160 for (let page = 0; page < pages && hasMore; page++) {
161 if (page > 0) {
162 await sleep(delayMs);
163 }
164
165 try {
166 const videosResponse = await requestTtviewer(
167 "/api/tiktok/get-videos",
168 {
169 secUid: user.secUid,
170 unique_id,
171 count,
172 cursor,
173 }
174 );
175
176 const data = videosResponse?.data || {};
177 const videoList = Array.isArray(data.videos) ? data.videos : [];
178
179 videos.push(...videoList.map(normalizeVideo));
180
181 hasMore = Boolean(data.hasMore);
182 cursor = data.cursor ?? 0;
183
184 if (!hasMore) break;
185 } catch (error) {
186 result.videosError = error.message;
187 break;
188 }
189 }
190
191 result.videos = videos;
192
193 return result;
194}
195
196module.exports = { stalkertiktok };
197
198(async () => {
199 try {
200 const data = await stalkertiktok("yuukii3k", {
201 includeVideos: true,
202 count: 6,
203 pages: 1,
204 delayMs: 800,
205 });
206
207 console.log(JSON.stringify(data, null, 2));
208 } catch (error) {
209 console.error("Error:", error.message);
210 }
211})();211 linesยท5,076 charsยท5.0 KB
WwrapยทFfullscreen