downloaderjavascript5114
Downr AIO Multi-Platform Media Downloader (50+ Platforms)
Engine scraper & downloader multi-platform serbaguna (TikTok, Facebook, YouTube, Pinterest, CapCut, Threads, dsb.). Mendukung video HD, SD, audio MP3, foto resolusi asli, dan tanpa Cloudflare block.
Vamz Spectre7 Okt 2026455 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/downr-media-downloader" -o downr-media-downloader.js
# 2. Jalankan script
node downr-media-downloader.js
Dependencies npm yang Dibutuhkan:
npm install axiosPanduan Penggunaan:
// Persyaratan: Node.js 18+ & modul axios
// 1. Install dependensi:
npm install axios
// 2. Simpan kode ke file: downr-media-downloader.js
// 3. Eksekusi via Terminal / CLI:
node downr-media-downloader.js "https://www.facebook.com/watch/?v=10153231379946729"
node downr-media-downloader.js "https://www.tiktok.com/@scout2015/video/6718335390845095173"
// 4. Integrasi Script Modular (CommonJS):
const { downr } = require(./downr-media-downloader);
async function test() {
const res = await downr("https://www.tiktok.com/@scout2015/video/6718335390845095173");
console.log(JSON.stringify(res, null, 2));
}
test();
// 5. Integrasi Bot WhatsApp (Baileys / VamxBotz):
case "downr":
case "fb":
case "tt": {
const url = text.trim();
if (!url) return m.reply("❌ Masukkan URL media (TikTok / Facebook).\nContoh: .downr https://www.facebook.com/watch/?v=xxxx");
await m.reply("⏳ Sedang memproses media...");
try {
const res = await downr(url);
if (!res.status) return m.reply("❌ " + res.message);
const data = res.result;
let caption = `🎬 *${data.title}*\n\n`;
caption += `📱 Platform: ${data.platform.toUpperCase()}\n`;
if (data.author) caption += `👤 Author: ${data.author}\n`;
caption += `\n⚡ *Pilihan Unduhan:*\n`;
data.formats.forEach((f, i) => {
caption += `${i + 1}. *${f.quality}* (${f.extension})\n`;
});
const videoFormat = data.formats.find(f => f.type === "video") || data.formats[0];
if (videoFormat?.downloadUrl) {
await conn.sendMessage(m.chat, {
video: { url: videoFormat.downloadUrl },
caption: caption
}, { quoted: m });
} else {
await m.reply(caption);
}
} catch (err) {
m.reply("❌ Error: " + err.message);
}
}downr-media-downloader.js(455 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
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
/**
* =====================================================================
* Downr AIO Multi-Platform Media Downloader Engine (50+ Platforms)
* Resolves media links: TikTok, Facebook, Instagram, YouTube,
* Twitter/X, Pinterest, CapCut, Threads, dsb.
*
* Author : Vamz Spectre / VamxAPI
* Official Website : https://vamxapi.my.id
* Target Reference : https://downr.org
* License : MIT
* =====================================================================
*/
const axios = require("axios");
const vm = require("node:vm");
// -------------------------------------------------------------
// 1. TIKTOK & DOUYIN RESOLVER (TikWM Engine)
// -------------------------------------------------------------
async function scrapeTikTok(url) {
const apiUrl = "https://www.tikwm.com/api/?url=" + encodeURIComponent(url) + "&hd=1";
const res = await fetch(apiUrl, {
headers: {
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
},
});
const data = await res.json();
if (data.code === 0 && data.data) {
const d = data.data;
const formats = [
d.hdplay ? { quality: "HD (No-Watermark)", type: "video", extension: "mp4", downloadUrl: d.hdplay } : null,
d.play ? { quality: "SD (No-Watermark)", type: "video", extension: "mp4", downloadUrl: d.play } : null,
d.music ? { quality: "Audio (MP3)", type: "audio", extension: "mp3", downloadUrl: d.music } : null,
].filter(Boolean);
return {
platform: "tiktok",
title: d.title || "TikTok Video",
author: d.author?.nickname || d.author?.unique_id,
thumbnail: d.cover,
duration: d.duration,
formatsCount: formats.length,
formats,
};
}
throw new Error("Gagal mengambil media TikTok: " + (data.msg || "Server sibuk"));
}
// -------------------------------------------------------------
// 2. FACEBOOK RESOLVER (SnapSave Engine)
// -------------------------------------------------------------
async function scrapeFacebook(url) {
const form = new URLSearchParams();
form.append("url", url);
const { data } = await axios.post("https://snapsave.app/action.php?lang=id", form, {
headers: {
origin: "https://snapsave.app",
referer: "https://snapsave.app/id",
"user-agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
},
timeout: 25000,
});
const ctx = {
window: {},
document: { getElementById: () => ({ innerHTML: "", value: "" }) },
console: console,
eval: (res) => res,
};
vm.createContext(ctx);
const decoded = vm.runInContext(data, ctx);
if (typeof decoded !== "string") {
throw new Error("Gagal mendekode respon Facebook.");
}
const regex = /https:\/\/d\.rapidcdn\.app\/v2\?[^"'\s\\]+/g;
const matches = decoded.match(regex);
const formats = [];
if (matches && matches.length > 0) {
const unique = [...new Set(matches)];
unique.forEach((u, i) => {
formats.push({
quality: i === 0 ? "HD" : "SD",
type: "video",
extension: "mp4",
downloadUrl: u.replace(/&/g, "&"),
});
});
}
if (formats.length === 0) {
throw new Error("Video tidak ditemukan atau link Facebook bersifat privat.");
}
return {
platform: "facebook",
title: "Facebook Video",
formatsCount: formats.length,
formats,
};
}
// -------------------------------------------------------------
// 3. YOUTUBE RESOLVER (SnapYT Engine)
// -------------------------------------------------------------
async function scrapeYouTube(url) {
const homeRes = await axios.get("https://www.snapyt.app/", {
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",
},
timeout: 10000,
});
const matchNonce =
homeRes.data.match(/var\s+VD_NONCE\s*=\s*"([^"]+)"/i) ||
homeRes.data.match(/"nonce":"([^"]+)"/i);
const nonce = matchNonce ? matchNonce[1] : "0f42e361f0";
const form = new URLSearchParams();
form.append("action", "process_video_url");
form.append("video_url", url);
form.append("security", nonce);
const procRes = await axios.post("https://www.snapyt.app/wp-admin/admin-ajax.php", form.toString(), {
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
Origin: "https://www.snapyt.app",
Referer: "https://www.snapyt.app/",
"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",
},
timeout: 20000,
});
if (!procRes.data?.success || !procRes.data?.data?.redirect) {
throw new Error(procRes.data?.data || "SnapYT tidak dapat memproses video YouTube ini.");
}
const redirectUrl = procRes.data.data.redirect;
const previewRes = await axios.get(redirectUrl, {
headers: {
Referer: "https://www.snapyt.app/",
"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",
},
timeout: 20000,
});
const previewHtml = previewRes.data;
const titleMatch = previewHtml.match(/<h1[^>]*>([\s\S]*?)<\/h1>/i) || previewHtml.match(/class="[^"]*video-title[^"]*"[^>]*>([\s\S]*?)<\//i);
const title = titleMatch ? titleMatch[1].replace(/<[^>]+>/g, "").trim() : "YouTube Video";
const formats = [];
const optRegex = /<option\s+([^>]+)>/gi;
let optMatch;
while ((optMatch = optRegex.exec(previewHtml)) !== null) {
const attrs = optMatch[1];
const urlMatch = attrs.match(/data-url="([^"]+)"/i) || attrs.match(/data-direct="([^"]+)"/i);
const labelMatch = attrs.match(/data-label="([^"]+)"/i);
const kindMatch = attrs.match(/data-kind="([^"]+)"/i);
const extMatch = attrs.match(/data-ext="([^"]+)"/i);
if (urlMatch && labelMatch) {
const directUrl = urlMatch[1].replace(/&/g, "&");
const label = labelMatch[1];
const ext = extMatch ? extMatch[1] : "mp4";
const isAudio = (kindMatch && kindMatch[1].includes("audio")) || label.includes("MP3") || label.includes("M4A");
formats.push({
quality: label,
type: isAudio ? "audio" : "video",
extension: ext,
downloadUrl: directUrl,
});
}
}
if (formats.length === 0) {
throw new Error("Gagal mengekstrak opsi resolusi video YouTube.");
}
return {
platform: "youtube",
title,
formatsCount: formats.length,
formats,
};
}
// -------------------------------------------------------------
// 4. PINTEREST RESOLVER (Direct Pin & Video Scraper)
// -------------------------------------------------------------
async function scrapePinterest(url) {
let target = url.trim();
if (target.includes("pin.it/")) {
const resHead = await fetch(target, { method: "HEAD", redirect: "follow" });
target = resHead.url || target;
}
const res = await fetch(target, {
headers: {
"User-Agent":
"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",
},
});
const html = await res.text();
const ogTitleMatch = html.match(/<meta property="og:title" content="([^"]+)"/i);
const title = ogTitleMatch ? ogTitleMatch[1] : "Pinterest Pin";
const formats = [];
const mp4Regex = /https:\/\/[^"'\s\\]+?\.mp4/g;
const mp4List = Array.from(new Set(html.match(mp4Regex) || []));
if (mp4List.length > 0) {
const bestMp4 = mp4List.find((u) => u.includes("720w") || u.includes("expMp4")) || mp4List[0];
formats.push({
quality: "HD Video",
type: "video",
extension: "mp4",
downloadUrl: bestMp4.replace(/\\u002F/g, "/").replace(/\\/g, ""),
});
}
const ogImageMatch = html.match(/<meta property="og:image" content="([^"]+)"/i);
if (ogImageMatch) {
const imgUrl = ogImageMatch[1].replace(/\/\d+x\//, "/originals/");
formats.push({
quality: "Original Photo",
type: "image",
extension: "jpg",
downloadUrl: imgUrl,
});
}
if (formats.length === 0) {
throw new Error("Media Pinterest tidak ditemukan atau privat.");
}
return {
platform: "pinterest",
title,
formatsCount: formats.length,
formats,
};
}
// -------------------------------------------------------------
// 5. CAPCUT RESOLVER (Template & Video Engine)
// -------------------------------------------------------------
async function scrapeCapCut(url) {
let target = url.trim();
if (target.includes("/t/") || target.includes("capcutshare.com")) {
const resHead = await fetch(target, { method: "GET", redirect: "follow" });
target = resHead.url || target;
}
const res = await fetch(target, {
headers: {
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
},
});
const html = await res.text();
const videoMatch = html.match(/"videoUrl":"([^"]+)"/i) || html.match(/"play_url":"([^"]+)"/i);
const titleMatch = html.match(/"title":"([^"]+)"/i);
if (videoMatch) {
const videoUrl = videoMatch[1].replace(/\\u002F/g, "/").replace(/\\/g, "");
return {
platform: "capcut",
title: titleMatch ? titleMatch[1] : "CapCut Video Template",
formatsCount: 1,
formats: [
{
quality: "Original HD",
type: "video",
extension: "mp4",
downloadUrl: videoUrl,
},
],
};
}
throw new Error("Gagal mengekstrak video CapCut.");
}
// -------------------------------------------------------------
// 6. THREADS RESOLVER (Meta Threads Engine)
// -------------------------------------------------------------
async function scrapeThreads(url) {
const apiUrl = "https://www.tikwm.com/api/?url=" + encodeURIComponent(url);
const res = await fetch(apiUrl, {
headers: {
"User-Agent":
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
},
});
const data = await res.json().catch(() => ({}));
if (data.code === 0 && data.data) {
const d = data.data;
return {
platform: "threads",
title: d.title || "Threads Post",
formatsCount: 1,
formats: [
{
quality: "HD Video/Post",
type: "video",
extension: "mp4",
downloadUrl: d.play || d.hdplay,
},
],
};
}
throw new Error("Gagal mengambil media Threads.");
}
// -------------------------------------------------------------
// 7. UNIVERSAL AIO FALLBACK (YouTube, Vimeo, Reddit, SoundCloud, dsb.)
// -------------------------------------------------------------
async function scrapeUniversalAIO(url) {
// Gunakan engine 9xbuddy AIO reverse-engineered
const { scrapeAIO } = await import("./aio-scraper.js").catch(() => ({}));
if (scrapeAIO) {
const aioRes = await scrapeAIO(url, { saveToCdn: false });
if (aioRes && aioRes.formats && aioRes.formats.length > 0) {
return {
platform: aioRes.type || "universal",
title: aioRes.title || "Media File",
formatsCount: aioRes.formats.length,
formats: aioRes.formats.map((f) => ({
quality: f.quality,
type: f.type,
extension: f.ext,
downloadUrl: f.url,
})),
};
}
}
throw new Error("Platform belum didukung atau link privat.");
}
// -------------------------------------------------------------
// MAIN ENTRY POINT: downr()
// -------------------------------------------------------------
async function downr(url) {
if (!url || typeof url !== "string") {
return {
status: false,
code: 400,
creator: "vamxapi",
message: "Parameter URL wajib diisi.",
};
}
const cleanUrl = url.trim();
try {
let resultData = null;
// 1. TikTok & Douyin
if (/tiktok\.com|douyin\.com/i.test(cleanUrl)) {
resultData = await scrapeTikTok(cleanUrl);
}
// 2. Facebook
else if (/facebook\.com|fb\.watch|fb\.com/i.test(cleanUrl)) {
resultData = await scrapeFacebook(cleanUrl);
}
// 3. YouTube
else if (/youtu\.be|youtube\.com/i.test(cleanUrl)) {
resultData = await scrapeYouTube(cleanUrl);
}
// 4. Pinterest
else if (/pinterest\.com|pin\.it/i.test(cleanUrl)) {
resultData = await scrapePinterest(cleanUrl);
}
// 5. CapCut
else if (/capcut\.com|capcutshare\.com/i.test(cleanUrl)) {
resultData = await scrapeCapCut(cleanUrl);
}
// 6. Threads
else if (/threads\.net/i.test(cleanUrl)) {
resultData = await scrapeThreads(cleanUrl);
}
// 7. Instagram
else if (/instagram\.com/i.test(cleanUrl)) {
// Coba TikWM Threads/IG bridge atau fallback
try {
resultData = await scrapeTikTok(cleanUrl);
} catch {
resultData = await scrapeUniversalAIO(cleanUrl);
}
}
// 8. Platform Lainnya (Vimeo, Reddit, SoundCloud, dsb.)
else {
resultData = await scrapeUniversalAIO(cleanUrl);
}
return {
status: true,
code: 200,
creator: "vamxapi",
result: {
url: cleanUrl,
...resultData,
},
};
} catch (error) {
return {
status: false,
code: 500,
creator: "vamxapi",
message: error.message || "Terjadi kesalahan internal pada scraper Downr.",
};
}
}
if (typeof module !== "undefined" && module.exports) {
module.exports = {
downr,
downloadMedia: downr,
};
}
// Eksekusi CLI jika dipanggil langsung via terminal
if (require.main === module) {
const args = process.argv.slice(2);
if (!args[0]) {
console.log("Usage: node downr-media-downloader.js <URL>");
console.log('Contoh 1: node downr-media-downloader.js "https://www.youtube.com/watch?v=dQw4w9WgXcQ"');
console.log('Contoh 2: node downr-media-downloader.js "https://www.facebook.com/watch/?v=10153231379946729"');
console.log('Contoh 3: node downr-media-downloader.js "https://pin.it/7x3..."');
process.exit(1);
}
downr(args[0])
.then((res) => {
console.log(JSON.stringify(res, null, 2));
})
.catch((err) => {
console.error("Error:", err.message);
});
}