scraperjavascript337
CineSubz - Sinhala Subtitles Movie & Stream Download Scraper
Direct movie/TV show search, catalog fetcher, safe-link/zt-links stream resolver, and multi-server Google/csplayer direct MP4 stream extractor for CineSubz (cinesubz.lk / cinesubz.net). Features zero Cloudflare captcha blocking and 100% safe mode (auto-filters adult/18+ content).
Vamz Spectre13 Okt 2026424 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/cinesubz-movie-scraper" -o cinesubz-movie-scraper.js
# 2. Jalankan script
node cinesubz-movie-scraper.js
cinesubz-movie-scraper.js(424 lines)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
/**
* ========================================================
* Name: CineSubz Movie, TV Shows & Stream Download Scraper
*
* Cara Download:
* curl -sL "https://code.vamxapi.my.id/snippet/raw/cinesubz-movie-scraper" -o cinesubz-movie-scraper.js
*
* Cara Eksekusi:
* node cinesubz-movie-scraper.js search "Spider-Man"
* node cinesubz-movie-scraper.js detail "https://cinesubz.net/movies/spider-man-brand-new-day-2026-sinhala-subtitles/"
* node cinesubz-movie-scraper.js latest movies 1
* node cinesubz-movie-scraper.js resolve "https://cinesubz.net/zt-links/nvm2e3d9ep/"
*
* Author: Vamz Spectre
* Source: https://vamxapi.my.id
* ========================================================
*/
const BASE_URL = "https://cinesubz.net";
const DEFAULT_HEADERS = {
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",
Accept: "text/html,application/json,*/*",
"Accept-Language": "en-US,en;q=0.9",
};
const URL_MAPPINGS = [
{ search: ["https://google.com/server11/1:/", "https://google.com/server12/1:/", "https://google.com/server13/1:/"], replace: "https://drive.csplayer2.space/server1/" },
{ search: ["https://google.com/server21/1:/", "https://google.com/server22/1:/", "https://google.com/server23/1:/"], replace: "https://drive.csplayer2.space/server2/" },
{ search: ["https://google.com/server3/1:/"], replace: "https://drive.csplayer2.space/server3/" },
{ search: ["https://google.com/server4/1:/"], replace: "https://drive.csplayer2.space/server4/" },
{ search: ["https://google.com/server5/1:/"], replace: "https://drive.csplayer2.space/server5/" },
{ search: ["https://google.com/server6/"], replace: "https://drive.csplayer2.space/server6/" },
{ search: ["https://google.com/server7/"], replace: "https://drive.csplayer2.space/server7/" }
];
let cachedNonce = null;
let nonceExpires = 0;
/**
* Ambil fresh security nonce dari frontend Zetaflix
*/
async function getNonce() {
const now = Date.now();
if (cachedNonce && now < nonceExpires) {
return cachedNonce;
}
try {
const res = await fetch(BASE_URL, { headers: DEFAULT_HEADERS });
const html = await res.text();
const match = html.match(/var ztGo\s*=\s*({[^;]+});/);
if (match) {
const obj = JSON.parse(match[1]);
if (obj.nonce) {
cachedNonce = obj.nonce;
nonceExpires = now + 15 * 60 * 1000;
return cachedNonce;
}
}
} catch {}
return "11c13d6e10";
}
/**
* 1. Search Movie / TV Shows
*/
async function search(query) {
const cleanQ = (query || "").trim();
if (!cleanQ) throw new Error("Query pencarian tidak boleh kosong!");
const nonce = await getNonce();
const searchUrl = `${BASE_URL}/wp-json/zetaflix/search/?keyword=${encodeURIComponent(cleanQ)}&nonce=${nonce}`;
const res = await fetch(searchUrl, { headers: DEFAULT_HEADERS });
if (!res.ok) throw new Error(`Pencarian gagal: HTTP ${res.status}`);
const data = await res.json();
if (data.error) throw new Error(data.title || "Gagal melakukan pencarian");
const results = Object.entries(data)
.map(([id, item]) => {
const genres = item.extra?.genres ? item.extra.genres.split(",").map(g => g.trim()) : [];
const isAdult = genres.some(g => g.toLowerCase() === "18" || g.toLowerCase() === "18+");
return {
id,
title: item.title,
url: item.url,
thumbnail: item.img,
genres,
year: item.extra?.date || null,
imdb_rating: item.extra?.imdb || null,
runtime: item.extra?.runtime ? item.extra.runtime.replace(/tt\d+\s*/, "") : null,
is_adult: isAdult
};
})
.filter(item => !item.is_adult);
return {
status: true,
query: cleanQ,
total: results.length,
results
};
}
/**
* 2. Get Latest Movies or TV Shows
*/
async function getLatest(type = "movies", page = 1) {
const targetType = type === "tvshows" ? "tvshows" : "movies";
const url = page > 1 ? `${BASE_URL}/${targetType}/page/${page}/` : `${BASE_URL}/${targetType}/`;
const res = await fetch(url, { headers: DEFAULT_HEADERS });
if (!res.ok) throw new Error(`Gagal mengambil data katalog: HTTP ${res.status}`);
const html = await res.text();
const items = [];
const regex = /<div[^>]*id=["']item-(\d+)["'][^>]*>([\s\S]*?)<\/div>\s*<\/div>/gi;
let m;
while ((m = regex.exec(html)) !== null) {
const id = m[1];
const block = m[2];
const linkMatch = block.match(/<a[^>]*href=["']([^"']+)["'][^>]*title=["']([^"']+)["']/i);
const imgMatch = block.match(/<img[^>]*src=["']([^"']+)["']/i);
const qualityMatch = block.match(/<span[^>]*class=["']badge-quality-corner["'][^>]*>([\s\S]*?)<\/span>/i);
const imdbMatch = block.match(/<span[^>]*class=["']imdb-score["'][^>]*>([\s\S]*?)<\/span>/i);
if (linkMatch) {
items.push({
id,
title: linkMatch[2].trim(),
url: linkMatch[1],
thumbnail: imgMatch ? imgMatch[1] : null,
quality: qualityMatch ? qualityMatch[1].trim() : null,
imdb_rating: imdbMatch ? imdbMatch[1].trim() : null
});
}
}
return {
status: true,
type: targetType,
page: Number(page) || 1,
total: items.length,
results: items
};
}
/**
* 3. Resolve Direct Stream / Download dari ZT-Links & Safe Redirector
*/
async function resolveZtLink(rawUrl) {
if (!rawUrl) throw new Error("URL zt-link wajib disertakan!");
let ztUrl = rawUrl.trim().replace("cinesubz.lk", "cinesubz.net");
const res = await fetch(ztUrl, {
headers: {
...DEFAULT_HEADERS,
Referer: "https://cinesubz.net/",
},
});
if (!res.ok) throw new Error(`Gagal membuka link zt-links: HTTP ${res.status}`);
const html = await res.text();
const linkMatch = html.match(/<a[^>]*id=["']link["'][^>]*href=["']([^"']+)["']/i);
if (!linkMatch) throw new Error("Link unduhan tidak ditemukan di dalam halaman (mungkin sudah kedaluwarsa).");
const originalUrl = linkMatch[1];
let finalUrl = originalUrl;
for (const mapping of URL_MAPPINGS) {
for (const searchUrl of mapping.search) {
if (finalUrl.includes(searchUrl)) {
finalUrl = finalUrl.replace(searchUrl, mapping.replace);
if (finalUrl.includes(".mp4?bot=cscloud2bot&code=")) {
finalUrl = finalUrl.replace(".mp4?bot=cscloud2bot&code=", "?ext=mp4&bot=cscloud2bot&code=");
} else if (finalUrl.includes(".mp4")) {
finalUrl = finalUrl.replace(".mp4", "?ext=mp4");
} else if (finalUrl.includes(".mkv?bot=cscloud2bot&code=")) {
finalUrl = finalUrl.replace(".mkv?bot=cscloud2bot&code=", "?ext=mkv&bot=cscloud2bot&code=");
} else if (finalUrl.includes(".mkv")) {
finalUrl = finalUrl.replace(".mkv", "?ext=mkv");
} else if (finalUrl.includes(".zip")) {
finalUrl = finalUrl.replace(".zip", "?ext=zip");
}
break;
}
}
}
return {
status: true,
zt_url: rawUrl,
original_url: originalUrl,
direct_stream_url: finalUrl,
is_telegram: originalUrl.includes("t.me")
};
}
/**
* 4. Get Movie or TV Show Detail & Download Links
*/
async function getDetail(targetUrl) {
let url = targetUrl.trim();
if (!url.startsWith("http")) {
url = `${BASE_URL}/movies/${url.replace(/^\//, "").replace(/\/$/, "")}/`;
}
const res = await fetch(url, { headers: DEFAULT_HEADERS });
if (!res.ok) throw new Error(`Gagal mengakses detail: HTTP ${res.status}`);
const html = await res.text();
// Parse Title (prioritize og:title / title tag as Zetaflix uses h1 for CTA button)
const ogTitleMatch = html.match(/<meta property=["']og:title["'] content=["']([^"']+)["']/i);
const titleTagMatch = html.match(/<title>([^<]+)<\/title>/i);
let title = "Unknown Title";
if (ogTitleMatch && ogTitleMatch[1]) {
title = ogTitleMatch[1].replace(/–/g, "-").replace(/’/g, "'").trim();
} else if (titleTagMatch && titleTagMatch[1]) {
title = titleTagMatch[1].replace(/–/g, "-").replace(/’/g, "'").trim();
} else {
const titleMatch = html.match(/<h1[^>]*class=["']entry-title["'][^>]*>([\s\S]*?)<\/h1>/i);
title = titleMatch ? titleMatch[1].replace(/<[^>]+>/g, "").trim() : "Unknown Title";
}
// Parse Poster & Backdrop
const posterMatch = html.match(/<img[^>]*class=["'][^"']*poster[^"']*["'][^>]*src=["']([^"']+)["']/i) ||
html.match(/<div class=["']poster["']>[\s\S]*?<img[^>]*src=["']([^"']+)["']/i);
const backdropMatch = html.match(/<div class=["']backdrop["']>[\s\S]*?<img[^>]*src=["']([^"']+)["']/i);
// Parse Synopsis
const synopsisMatch = html.match(/<div[^>]*class=["']details-desc["'][^>]*>([\s\S]*?)<\/div>/i) ||
html.match(/<div[^>]*class=["']entry-content[^"']*["'][^>]*>([\s\S]*?)<\/div>/i) ||
html.match(/<p class=["']desc["']>([\s\S]*?)<\/p>/i);
const synopsis = synopsisMatch ? synopsisMatch[1].replace(/<[^>]+>/g, "").trim() : "";
// Parse Metadata
const imdbMatch = html.match(/IMDb:\s*([\d.]+)/i);
const qualityMatch = html.match(/<span[^>]*class=["']data-quality["'][^>]*>([\s\S]*?)<\/span>/i);
const genreMatch = html.match(/<div[^>]*class=["']details-genre["'][^>]*>([\s\S]*?)<\/div>/i);
const genres = genreMatch ? genreMatch[1].replace(/<[^>]+>/g, "").split(",").map(g => g.trim()) : [];
// Parse Cast
const cast = [];
const castRegex = /class=["']zt-cast-name["']>([^<]+)<\/(?:span|div)>[\s\S]*?class=["']zt-cast-role["']>([^<]+)<\/(?:span|div)>/gi;
let cm;
while ((cm = castRegex.exec(html)) !== null) {
cast.push({ name: cm[1].trim(), role: cm[2].trim() });
}
// Parse Download Links (both zt-links and api- safe redirector)
const dlRegex = /<a[^>]*href=["'](https:\/\/cinesubz\.(?:net|lk)\/(?:zt-links|api-[^/"']+)\/[^"']+)["'][^>]*>([\s\S]*?)<\/a>/gi;
const downloadLinks = [];
let dm;
while ((dm = dlRegex.exec(html)) !== null) {
const linkUrl = dm[1];
const buttonBody = dm[2];
const metaMatch = buttonBody.match(/class=["']movie-download-meta["']>([^<]+)<\/span>/i);
const rawLabel = metaMatch
? metaMatch[1].trim()
: buttonBody.replace(/<[^>]+>/g, "").replace(/Direct & Telegram Download Links/g, "").trim();
// Parse Resolution, Size & Language from Label
const parts = rawLabel.split("•").map(p => p.trim());
const quality = parts[0] || rawLabel;
const size = parts[1] || null;
const audio = parts[2] || null;
downloadLinks.push({
label: rawLabel,
quality,
size,
audio,
zt_url: linkUrl
});
}
return {
status: true,
url,
title,
poster: posterMatch ? posterMatch[1] : null,
backdrop: backdropMatch ? backdropMatch[1] : null,
imdb_rating: imdbMatch ? imdbMatch[1] : null,
quality: qualityMatch ? qualityMatch[1].trim() : null,
genres,
synopsis,
cast: cast.slice(0, 10),
download_links: downloadLinks
};
}
/**
* Universal Scraper Dispatcher
*/
async function cinesubz(command, ...rest) {
const clean = (command || "").trim();
if (!clean) throw new Error("Parameter input (query, URL movie, atau sub-command) wajib disertakan!");
const lower = clean.toLowerCase();
// Sub-command: search
if (lower === "search") {
const query = rest.join(" ").trim();
if (!query) throw new Error("Query pencarian tidak boleh kosong!");
return await search(query);
}
// Sub-command: detail
if (lower === "detail") {
const targetUrl = rest[0];
if (!targetUrl) throw new Error("URL detail movie tidak boleh kosong!");
return await getDetail(targetUrl);
}
// Sub-command: latest
if (lower === "latest") {
const type = (rest[0] === "tvshows" || rest[0] === "movies") ? rest[0] : "movies";
const page = rest[1] ? Number(rest[1]) : (!isNaN(Number(rest[0])) ? Number(rest[0]) : 1);
return await getLatest(type, page);
}
// Sub-command: resolve
if (lower === "resolve") {
const ztUrl = rest[0];
if (!ztUrl) throw new Error("URL zt-link tidak boleh kosong!");
return await resolveZtLink(ztUrl);
}
// Direct zt-links URL
if (clean.includes("/zt-links/")) {
return await resolveZtLink(clean);
}
// Direct movie detail URL
if (clean.startsWith("http://") || clean.startsWith("https://")) {
const detail = await getDetail(clean);
if (detail.download_links && detail.download_links.length > 0) {
try {
const first = detail.download_links[0];
const resolved = await resolveZtLink(first.zt_url);
first.resolved_stream = resolved.direct_stream_url;
} catch {}
}
return detail;
}
// Shorthand category
if (clean === "movies" || clean === "tvshows") {
return await getLatest(clean, rest[0] ? Number(rest[0]) : 1);
}
// Default: dianggap query pencarian
return await search([clean, ...rest].join(" ").trim());
}
// CommonJS safe export
if (typeof module !== "undefined" && module.exports) {
module.exports = {
cinesubz,
search,
getLatest,
getDetail,
resolveZtLink
};
}
/**
* CLI Runner:
* Langsung eksekusi via terminal:
* node cinesubz-movie-scraper.js search "Spider-Man"
* node cinesubz-movie-scraper.js detail "https://cinesubz.net/movies/spider-man-brand-new-day-2026-sinhala-subtitles/"
* node cinesubz-movie-scraper.js latest movies 1
* node cinesubz-movie-scraper.js resolve "https://cinesubz.net/zt-links/nvm2e3d9ep/"
*/
const cliArgs = process.argv.slice(2);
const mainCommand = cliArgs[0] ? cliArgs[0].trim() : null;
async function runCli() {
if (!mainCommand) {
console.log(
JSON.stringify(
{
status: false,
message: "Parameter sub-command belum ditentukan.",
usage: {
search: "node cinesubz-movie-scraper.js search <judul_film>",
detail: "node cinesubz-movie-scraper.js detail <url_film>",
latest: "node cinesubz-movie-scraper.js latest [movies|tvshows] [page]",
resolve: "node cinesubz-movie-scraper.js resolve <zt_link_url>"
},
examples: [
"node cinesubz-movie-scraper.js search \"Spider-Man\"",
"node cinesubz-movie-scraper.js detail \"https://cinesubz.net/movies/spider-man-brand-new-day-2026-sinhala-subtitles/\"",
"node cinesubz-movie-scraper.js latest movies 1",
"node cinesubz-movie-scraper.js resolve \"https://cinesubz.net/zt-links/nvm2e3d9ep/\""
]
},
null,
2
)
);
process.exit(1);
}
const res = await cinesubz(mainCommand, ...cliArgs.slice(1));
console.log(JSON.stringify(res, null, 2));
}
if (process.argv[1]) {
runCli().catch((err) => {
console.error(JSON.stringify({ status: false, error: err.message }, null, 2));
process.exit(1);
});
}