generaljavascript81
SL Media Downloader & Stream Resolver
Multi-platform Sri Lanka media stream & download resolver for CineSubz (zt-links / api redirector), SinhalaCHR Cloudflare Workers, and UsersDrive. Features zero Cloudflare captcha blocking and 100% safe mode (auto-filters adult/18+ content).
Vamz Spectre13 Okt 2026357 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/sl-media-downloader" -o sl-media-downloader.js
# 2. Jalankan script
node sl-media-downloader.js
sl-media-downloader.js(357 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
/**
* ========================================================
* Name: SL Media Downloader & Stream Resolver (Zero CF & Safe/No 18)
*
* Multi-Platform Media Extractor & Stream Resolver:
* 1. CineSubz (cinesubz.lk / cinesubz.net / zt-links / api redirector)
* 2. SinhalaCHR Cloudflare Workers (sinhalachr.workers.dev)
* 3. UsersDrive File Host (usersdrive.com)
*
* Cara Download:
* curl -sL "https://code.vamxapi.my.id/snippet/raw/sl-media-downloader" -o sl-media-downloader.js
*
* Cara Eksekusi:
* node sl-media-downloader.js "https://cinesubz.net/zt-links/nvm2e3d9ep/"
* node sl-media-downloader.js "https://iws.sinhalachr.workers.dev/?id=HdaKhupc8mNuambr8F1UUvdQ&assetToken=V8iqjRWAxddTFaQD2DZ6qdZM"
* node sl-media-downloader.js "https://usersdrive.com/api/download-data/ce5wq9m88s4v.html"
* node sl-media-downloader.js search "Spider-Man"
*
* Author: Vamz Spectre
* Source: https://vamxapi.my.id
* ========================================================
*/
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,text/plain,*/*",
"Accept-Language": "en-US,en;q=0.9",
};
const CINESUBZ_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/" },
];
/**
* 1. Resolver CineSubz (Zero Cloudflare, Fast LiteSpeed Handshake)
*/
async function resolveCineSubz(targetUrl) {
let url = targetUrl.trim().replace("cinesubz.lk", "cinesubz.net");
const res = await fetch(url, {
headers: {
...DEFAULT_HEADERS,
Referer: "https://cinesubz.net/",
},
});
if (!res.ok) {
throw new Error(`Link CineSubz gagal dibuka atau sudah kedaluwarsa (HTTP ${res.status}).`);
}
const html = await res.text();
const linkMatch = html.match(/<a[^>]*id=["']link["'][^>]*href=["']([^"']+)["']/i);
const titleMatch = html.match(/<title>([^<]+)<\/title>/i);
const prevLinkMatch = html.match(/<a[^>]*class=["']prev-lnk["'][^>]*href=["']([^"']+)["']/i);
if (!linkMatch) {
if (html.includes("Page not found") || html.includes("Please contact Admin")) {
throw new Error("Link unduhan CineSubz sudah kedaluwarsa atau tidak valid di server.");
}
throw new Error("Elemen link unduhan tidak ditemukan di dalam halaman CineSubz.");
}
const originalUrl = linkMatch[1];
let finalStreamUrl = originalUrl;
for (const mapping of CINESUBZ_URL_MAPPINGS) {
let matched = false;
for (const searchUrl of mapping.search) {
if (finalStreamUrl.includes(searchUrl)) {
finalStreamUrl = finalStreamUrl.replace(searchUrl, mapping.replace);
if (finalStreamUrl.includes(".mp4?bot=cscloud2bot&code=")) {
finalStreamUrl = finalStreamUrl.replace(".mp4?bot=cscloud2bot&code=", "?ext=mp4&bot=cscloud2bot&code=");
} else if (finalStreamUrl.includes(".mp4")) {
finalStreamUrl = finalStreamUrl.replace(".mp4", "?ext=mp4");
} else if (finalStreamUrl.includes(".mkv?bot=cscloud2bot&code=")) {
finalStreamUrl = finalStreamUrl.replace(".mkv?bot=cscloud2bot&code=", "?ext=mkv&bot=cscloud2bot&code=");
} else if (finalStreamUrl.includes(".mkv")) {
finalStreamUrl = finalStreamUrl.replace(".mkv", "?ext=mkv");
} else if (finalStreamUrl.includes(".zip")) {
finalStreamUrl = finalStreamUrl.replace(".zip", "?ext=zip");
}
matched = true;
break;
}
}
if (matched) break;
}
const isTelegram = originalUrl.includes("t.me") || originalUrl.includes("srilanka2222");
return {
status: true,
platform: "CineSubz",
type: isTelegram ? "telegram_channel" : "direct_video_stream",
title: titleMatch ? titleMatch[1].replace(/–/g, "-").replace(/’/g, "'").trim() : "CineSubz Media",
movie_page: prevLinkMatch ? prevLinkMatch[1] : null,
target_url: targetUrl,
original_url: originalUrl,
direct_stream_url: finalStreamUrl,
is_telegram: isTelegram,
};
}
/**
* 2. Extractor SinhalaCHR Cloudflare Worker Media
*/
async function resolveSinhalaCHR(targetUrl) {
const url = targetUrl.trim();
const res = await fetch(url, {
headers: DEFAULT_HEADERS,
});
if (!res.ok) {
throw new Error(`Gagal mengakses SinhalaCHR Worker: HTTP ${res.status}`);
}
const html = await res.text();
const titleMatch = html.match(/<strong>Title:<\/strong>\s*([^<]+)<\/p>/i);
const sizeMatch = html.match(/<strong>Size:<\/strong>\s*([^<]+)<\/p>/i);
const resMatch = html.match(/<strong>Resolution:<\/strong>\s*([^<]+)<\/p>/i);
const videoSourceMatch = html.match(/<source\s+src=["']([^"']+)["']/i);
const telegramMatch = html.match(/<a\s+href=["'](https:\/\/t\.me\/[^"']+)["']/i);
const parsedUrl = new URL(url);
const id = parsedUrl.searchParams.get("id");
const assetToken = parsedUrl.searchParams.get("assetToken");
const downloadUrl = id && assetToken
? `${parsedUrl.origin}/?id=${encodeURIComponent(id)}&assetToken=${encodeURIComponent(assetToken)}&download=true`
: null;
const streamUrl = videoSourceMatch ? videoSourceMatch[1] : null;
return {
status: true,
platform: "SinhalaCHR Workers",
type: "direct_video_stream",
title: titleMatch ? titleMatch[1].trim() : "SinhalaCHR Media",
size: sizeMatch ? sizeMatch[1].trim() : null,
resolution: resMatch ? resMatch[1].trim() : null,
direct_stream_url: streamUrl,
direct_download_url: downloadUrl,
telegram_channel: telegramMatch ? telegramMatch[1] : "https://t.me/sinhalaaaa",
source_url: targetUrl,
};
}
/**
* 3. Extractor UsersDrive File Hosting (Zero CF)
*/
async function resolveUsersDrive(targetUrl) {
const url = targetUrl.trim();
const fileIdMatch = url.match(/\/([a-zA-Z0-9]+)(?:\.html)?(?:$|[?#])/);
if (!fileIdMatch || !fileIdMatch[1]) {
throw new Error("Gagal membaca File ID dari link UsersDrive.");
}
const fileId = fileIdMatch[1];
const standardPageUrl = `https://usersdrive.com/${fileId}.html`;
const res = await fetch(standardPageUrl, {
headers: DEFAULT_HEADERS,
});
if (!res.ok) {
throw new Error(`Gagal membuka link UsersDrive: HTTP ${res.status}`);
}
const html = await res.text();
if (html.includes("File Not Found") || html.includes("deleted by the owner")) {
throw new Error("File di UsersDrive tidak ditemukan atau sudah dihapus oleh uploader.");
}
const nameMatch = html.match(/<h4>([^<]+)<\/h4>/i) || html.match(/<meta name="description" content="Download File ([^"]+)">/i);
const sizeMatch = html.match(/<span class="size"[^>]*>([\s\S]*?)<\/span>/i);
const dateMatch = html.match(/Uploaded on\s*<b>([\s\S]*?)<\/b>\s*([\d:]+)/i);
const uploaderMatch = html.match(/<a href="https:\/\/usersdrive\.com\/users\/([^"]+)"/i);
const rawBytesMatch = html.match(/\[URL=https:\/\/usersdrive\.com\/[^\]]+\][^<]*-\s*(\d+)\[\/URL\]/i);
return {
status: true,
platform: "UsersDrive",
type: "file_download_page",
file_id: fileId,
title: nameMatch ? nameMatch[1].trim() : `UsersDrive_${fileId}`,
size: sizeMatch ? sizeMatch[1].replace(/<[^>]+>/g, "").trim() : null,
size_bytes: rawBytesMatch ? Number(rawBytesMatch[1]) : null,
upload_date: dateMatch ? `${dateMatch[1].trim()} ${dateMatch[2].trim()}` : null,
uploader: uploaderMatch ? uploaderMatch[1].trim() : null,
page_url: standardPageUrl,
tracker_torrent_url: `https://usersdrive.com/cgi-bin/tracker.cgi?file_code=${fileId}`,
source_url: targetUrl,
};
}
/**
* 4. Search CineSubz Catalog (Safe Mode / Exclude 18+ Genre)
*/
async function searchCineSubz(query) {
const cleanQ = (query || "").trim();
if (!cleanQ) throw new Error("Query pencarian tidak boleh kosong!");
const searchUrl = `https://cinesubz.net/wp-json/zetaflix/search/?keyword=${encodeURIComponent(cleanQ)}&nonce=11c13d6e10`;
const res = await fetch(searchUrl, { headers: DEFAULT_HEADERS });
if (!res.ok) throw new Error(`Pencarian CineSubz 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 out 18+ content strictly
.filter((item) => !item.is_adult);
return {
status: true,
platform: "CineSubz",
query: cleanQ,
total: results.length,
results,
};
}
/**
* Universal Dispatcher: Auto-detects platform URL
*/
async function resolve(target) {
const input = (target || "").trim();
if (!input) {
throw new Error("Parameter URL atau query wajib disertakan!");
}
// 1. SinhalaCHR Workers
if (input.includes("sinhalachr.workers.dev")) {
return await resolveSinhalaCHR(input);
}
// 2. UsersDrive
if (input.includes("usersdrive.com")) {
return await resolveUsersDrive(input);
}
// 3. CineSubz
if (input.includes("cinesubz.lk") || input.includes("cinesubz.net") || input.includes("zt-links") || input.includes("api-")) {
return await resolveCineSubz(input);
}
// Fallback: search CineSubz
return await searchCineSubz(input);
}
// Safe Export
if (typeof module !== "undefined" && module.exports) {
module.exports = {
resolve,
resolveCineSubz,
resolveSinhalaCHR,
resolveUsersDrive,
searchCineSubz,
default: resolve,
};
}
// CLI Runner
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 URL atau query belum disertakan.",
usage: {
universal: "node sl-media-downloader.js <url_or_query>",
search: "node sl-media-downloader.js search <movie_name>",
cinesubz: "node sl-media-downloader.js cinesubz <url_cinesubz>",
sinhalachr: "node sl-media-downloader.js sinhalachr <url_sinhalachr>",
usersdrive: "node sl-media-downloader.js usersdrive <url_usersdrive>",
},
examples: [
'node sl-media-downloader.js "https://cinesubz.net/zt-links/nvm2e3d9ep/"',
'node sl-media-downloader.js "https://iws.sinhalachr.workers.dev/?id=HdaKhupc8mNuambr8F1UUvdQ&assetToken=V8iqjRWAxddTFaQD2DZ6qdZM"',
'node sl-media-downloader.js "https://usersdrive.com/api/download-data/ce5wq9m88s4v.html"',
'node sl-media-downloader.js search "Spider-Man"',
],
},
null,
2
)
);
process.exit(1);
}
let result;
if (mainCommand === "search" && cliArgs[1]) {
result = await searchCineSubz(cliArgs.slice(1).join(" "));
} else if (mainCommand === "cinesubz" && cliArgs[1]) {
result = await resolveCineSubz(cliArgs[1]);
} else if (mainCommand === "sinhalachr" && cliArgs[1]) {
result = await resolveSinhalaCHR(cliArgs[1]);
} else if (mainCommand === "usersdrive" && cliArgs[1]) {
result = await resolveUsersDrive(cliArgs[1]);
} else {
result = await resolve(mainCommand);
}
console.log(JSON.stringify(result, null, 2));
}
if (process.argv[1]) {
runCli().catch((err) => {
console.error(JSON.stringify({ status: false, error: err.message || String(err) }, null, 2));
process.exit(1);
});
}