downloaderjavascript4812
FastDL Instagram Video & Reels Downloader Engine
Engine scraper FastDL.app dengan reverse-engineered HMAC-SHA256 signature cryptographic loader, Node.js VM headless execution, dan Cloudflare Turnstile handler.
Vamz Spectre30 Sep 2026259 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/fastdl-instagram-downloader" -o fastdl-instagram-downloader.js
# 2. Jalankan script
node fastdl-instagram-downloader.js
Panduan Penggunaan:
// Penggunaan CLI:
node fastdl-instagram-downloader.js "https://www.instagram.com/reel/DC5zT2ySPuM/"
// Penggunaan Modular (Node.js):
const { scrapeFastDl, getFastDlSigner } = require(./fastdl-instagram-downloader);
const result = await scrapeFastDl("https://www.instagram.com/reel/DC5zT2ySPuM/");
console.log(result);fastdl-instagram-downloader.js(259 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
/**
* FastDL Scraper & Signature Generator - Instagram Video Downloader
* Target: https://fastdl.app/en3Zu/video
* Author: Vamz Spectre
*
* Fitur:
* - Dynamic Chunk & Webpack Loader: Mengambil dan mengeksekusi chunk modul link/signature (link.chunk.js) secara headless via Node.js VM.
* - Dynamic Signature Generation: Menghasilkan parameter `_s` (HMAC SHA-256), `_ts`, `_tsc`, `_sv`, dan `ts` secara presisi sesuai engine resmi fastdl.
* - Cloudflare Turnstile & Captcha Support: Mendeteksi tantangan Turnstile (siteKey) & support injection token token via header `wh-cf-token` atau `x-token`.
* - Parsing Media Respons: Menangani ekstraksi video MP4, foto/slideshow, thumbnail, dan link download direct.
*/
const vm = require("vm");
const https = require("https");
const FASTDL_BASE_URL = "https://fastdl.app";
const DEFAULT_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";
let cachedSigner = null;
/**
* Fetch data via HTTPS helper
*/
function fetchHttps(url, options = {}, postData = null) {
return new Promise((resolve, reject) => {
const parsed = new URL(url);
const opts = {
hostname: parsed.hostname,
port: parsed.port || 443,
path: parsed.pathname + parsed.search,
method: options.method || (postData ? "POST" : "GET"),
headers: {
"User-Agent": DEFAULT_USER_AGENT,
...(options.headers || {}),
},
};
if (postData) {
opts.headers["Content-Length"] = Buffer.byteLength(postData);
}
const req = https.request(opts, (res) => {
const chunks = [];
res.on("data", (chunk) => chunks.push(chunk));
res.on("end", () => {
const data = Buffer.concat(chunks).toString("utf-8");
resolve({
status: res.statusCode,
headers: res.headers,
data,
});
});
});
req.on("error", reject);
if (postData) req.write(postData);
req.end();
});
}
/**
* Mendapatkan URL chunk link terbaru dari app.js fastdl.app
*/
async function getLinkChunkUrl() {
const pageRes = await fetchHttps(`${FASTDL_BASE_URL}/en3Zu/video`);
const appMatch = pageRes.data.match(/\/js\/app\.js\?id=[a-f0-9]+/);
const appPath = appMatch ? appMatch[0] : "/js/app.js";
const appRes = await fetchHttps(`${FASTDL_BASE_URL}${appPath}`);
const chunkMatch = appRes.data.match(/54:"([a-f0-9]+)"/);
const hash = chunkMatch ? chunkMatch[1] : "";
return `${FASTDL_BASE_URL}/js/link.chunk.js${hash ? `?ch=${hash}` : ""}`;
}
/**
* Menginisialisasi VM Node.js untuk mengeksekusi modul signature generator FastDL
*/
async function getFastDlSigner() {
if (cachedSigner) return cachedSigner;
const chunkUrl = await getLinkChunkUrl();
const chunkRes = await fetchHttps(chunkUrl);
const chunkSrc = chunkRes.data;
const mockWindow = {
location: { hostname: "fastdl.app" },
top: null,
document: { referrer: "" },
setInterval: () => {},
clearInterval: () => {},
setTimeout: (fn, ms) => setTimeout(fn, ms),
clearTimeout: (id) => clearTimeout(id),
atob: (s) => Buffer.from(s, "base64").toString("binary"),
btoa: (s) => Buffer.from(s, "binary").toString("base64"),
Uint8Array,
TextDecoder,
TextEncoder,
AbortController,
crypto: require("crypto").webcrypto,
};
mockWindow.top = mockWindow;
let pushedModules = null;
const webpackChunk = [];
webpackChunk.push = (args) => {
pushedModules = args[1];
};
const sandbox = {
window: mockWindow,
globalThis: mockWindow,
self: mockWindow,
location: mockWindow.location,
document: mockWindow.document,
setInterval: mockWindow.setInterval,
clearInterval: mockWindow.clearInterval,
setTimeout: mockWindow.setTimeout,
clearTimeout: mockWindow.clearTimeout,
atob: mockWindow.atob,
btoa: mockWindow.btoa,
Uint8Array,
TextDecoder,
TextEncoder,
AbortController,
console,
fetch: async () => ({ json: async () => ({ msec: Date.now() / 1000 }) }),
crypto: mockWindow.crypto,
};
mockWindow.webpackChunk = webpackChunk;
sandbox.webpackChunk = webpackChunk;
vm.createContext(sandbox);
vm.runInContext(chunkSrc, sandbox);
const installedModules = {};
function __webpack_require__(moduleId) {
if (installedModules[moduleId]) return installedModules[moduleId].exports;
const module = (installedModules[moduleId] = { exports: {} });
pushedModules[moduleId](module, module.exports, __webpack_require__);
return module.exports;
}
__webpack_require__.r = (exports) => {
if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
}
Object.defineProperty(exports, "__esModule", { value: true });
};
__webpack_require__.d = (exports, definition) => {
for (const key in definition) {
if (
Object.prototype.hasOwnProperty.call(definition, key) &&
!Object.prototype.hasOwnProperty.call(exports, key)
) {
Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
}
}
};
const mod7027 = __webpack_require__("7027");
cachedSigner = await mod7027.default;
return cachedSigner;
}
/**
* Scraper FastDL Instagram Downloader
* @param {string} instagramUrl - URL postingan / Reels Instagram
* @param {object} options - Opsi tambahan seperti cfToken / turnstile token
*/
async function scrapeFastDl(instagramUrl, options = {}) {
if (!instagramUrl || typeof instagramUrl !== "string") {
throw new Error("Instagram URL is required");
}
// 1. Generate cryptographic signature via FastDL link engine
const signer = await getFastDlSigner();
const signedPayload = await signer(instagramUrl.trim());
// 2. Siapkan headers request
const headers = {
"Content-Type": "application/json",
Origin: "https://fastdl.app",
Referer: "https://fastdl.app/en3Zu/video",
};
if (options.cfToken) {
headers["wh-cf-token"] = options.cfToken;
}
if (options.token) {
headers["x-token"] = options.token;
}
// 3. Kirim request ke endpoint konversi
const res = await fetchHttps(
`${FASTDL_BASE_URL}/api/convert`,
{
method: "POST",
headers,
},
JSON.stringify(signedPayload)
);
let json;
try {
json = JSON.parse(res.data);
} catch {
json = { raw: res.data };
}
// Handle Turnstile Captcha challenge
if (res.status === 422 || json.code === "CAPTCHA_REQUIRED") {
return {
status: false,
code: "CAPTCHA_REQUIRED",
message: "FastDL memerlukan verifikasi Cloudflare Turnstile.",
challenge: json.challenge || {
type: "turnstile",
siteKey: "0x4AAAAAABhLwGG2XCb7fE2M",
},
signedPayload,
};
}
if (res.status !== 200 || json.error) {
return {
status: false,
code: res.status,
message: json.message || json.error || "Gagal memproses media dari FastDL",
data: json,
};
}
return {
status: true,
result: json,
};
}
if (typeof module !== "undefined" && module.exports) {
module.exports = {
scrapeFastDl,
getFastDlSigner,
};
}
// CLI Execution
if (require.main === module) {
const targetUrl = process.argv[2] || "https://www.instagram.com/reel/DC5zT2ySPuM/";
console.log(`š Scraping FastDL for: ${targetUrl}`);
scrapeFastDl(targetUrl)
.then((res) => {
console.log("\nš¦ Result:\n", JSON.stringify(res, null, 2));
})
.catch((err) => {
console.error("ā Error:", err.message);
});
}