aijavascript2711
DeepAI AI Photo & Image Editor Scraper
Bypass dan scraper AI Photo & Image Editor dari DeepAI dengan signature reverse-engineering, dynamic Tor stream isolation, universal proxy support (--proxy), dan direct image output.
Vamz Spectre25 Okt 2026517 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/deepai-image-editor" -o deepai-image-editor.js
# 2. Jalankan script
node deepai-image-editor.js
Dependencies npm yang Dibutuhkan:
npm install None (Built-in Node.js + Google Chrome/Chromium)Panduan Penggunaan:
Cara Download: curl -sL "https://code.vamxapi.my.id/snippet/raw/deepai-image-editor" -o deepai-image-editor.js Cara Eksekusi: node deepai-image-editor.js "<image_path_or_url>" "<edit_instruction_prompt>" Contoh: node deepai-image-editor.js "https://images.deepai.org/machine-learning-models/ba25fbba57eb410e9e2038b78eac5d9a/f078fe461c9c4046be4d810e9e4bb798.webp" "make it sunset with bright warm lighting"
deepai-image-editor.js(517 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
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
/**
* DeepAI AI Photo & Image Editor Scraper & Free Unlimited Bypass Engine
* Target: https://deepai.org/machine-learning-model/image-editor
* Author: Vamz Spectre (VamxAPI)
*
* Capabilities:
* - 100% Free Unlimited Bypass: Menggunakan reverse-engineering signature DeepAI + Dynamic Proxy & Tor Stream Isolation.
* - Berhasil melewati proteksi anti-bot token (_axwrt), signature hashing (tryitApiKey), dan bypass tuntas kuota IP ("anonymous try it exceeded" & "signed in try-it quota exceeded").
* - Native Zero-Dependency: Tidak memerlukan modul npm tambahan ataupun browser Chrome, berjalan instan via native TLS/HTTP.
* - Universal Proxy Support: Mendukung SOCKS5, HTTP CONNECT proxy, local Tor (127.0.0.1:9050), serta direct fallback jika proxy tidak aktif.
* - Auto-Retry & IP Rotation: Otomatis meminta circuit/IP baru bila exit node terkena rate limit atau filter edge.
* - Mendukung Mode Direct Pro jika memiliki custom DEEPAI_API_KEY.
* - Mendukung Remote Image URLs, Path File Gambar Lokal, dan Base64 Data URI.
* - Output JSON murni dengan direct image URL.
*
* Download & Run (1:1 Konsisten):
* curl -sL "https://code.vamxapi.my.id/snippet/raw/deepai-image-editor" -o deepai-image-editor.js
*
* Usage:
* node deepai-image-editor.js "<image_path_or_url>" "<edit_instruction_prompt>" [--proxy "<proxy_url>"]
*
* Examples:
* # Default (Auto-detect Tor / direct):
* node deepai-image-editor.js "https://images.deepai.org/machine-learning-models/ba25fbba57eb410e9e2038b78eac5d9a/f078fe461c9c4046be4d810e9e4bb798.webp" "make it sunset with bright warm lighting"
*
* # Custom HTTP/SOCKS5 Proxy (jika Tor lokal / 127 tidak dipakai atau diblokir):
* node deepai-image-editor.js "image.jpg" "enhance photo quality" --proxy "http://user:[email protected]:8080"
*/
const fs = require("fs");
const net = require("net");
const tls = require("tls");
const https = require("https");
const crypto = require("crypto");
const API_BASE_URL = "https://api.deepai.org";
const MODEL_ID = "image-editor";
const DEFAULT_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36";
const SALT = "hackers_become_a_little_stinkier_every_time_they_hack";
function myHashFunction(str) {
return crypto.createHash("md5").update(str, "utf8").digest("hex").split("").reverse().join("");
}
function generateTryitApiKey(userAgent = DEFAULT_UA) {
const randomStr = String(Math.round(Math.random() * 100000000000));
const hash1 = myHashFunction(userAgent + randomStr + SALT);
const hash2 = myHashFunction(userAgent + hash1);
const hash3 = myHashFunction(userAgent + hash2);
return `tryit-${randomStr}-${hash3}`;
}
async function resolveImageInput(input) {
if (typeof input === "string") {
const trimmed = input.trim();
if (trimmed.startsWith("http://") || trimmed.startsWith("https://")) {
return { type: "url", value: trimmed };
}
if (fs.existsSync(trimmed)) {
const buffer = fs.readFileSync(trimmed);
const extMatch = trimmed.match(/\.([a-zA-Z0-9]+)$/);
const ext = extMatch ? extMatch[1].toLowerCase() : "jpg";
const mime = ext === "png" ? "image/png" : ext === "webp" ? "image/webp" : "image/jpeg";
return { type: "buffer", buffer, mime, filename: `image.${ext}` };
}
if (trimmed.startsWith("data:image/")) {
const match = trimmed.match(/^data:(image\/[a-zA-Z0-9_\-]+);base64,(.+)$/);
if (match) {
return {
type: "buffer",
buffer: Buffer.from(match[2], "base64"),
mime: match[1],
filename: "image.jpg"
};
}
}
}
if (Buffer.isBuffer(input)) {
return { type: "buffer", buffer: input, mime: "image/jpeg", filename: "image.jpg" };
}
throw new Error(`Input gambar tidak valid atau file tidak ditemukan: ${input}`);
}
/**
* Cek apakah host:port terbuka
*/
function isPortOpen(host, port, timeout = 600) {
return new Promise((resolve) => {
const s = net.connect(port, host, () => {
s.destroy();
resolve(true);
});
s.setTimeout(timeout, () => {
s.destroy();
resolve(false);
});
s.on("error", () => {
s.destroy();
resolve(false);
});
});
}
/**
* Native SOCKS5 TLS Socket Handler dengan Tor Stream Isolation & Custom Proxy
*/
function createSocks5TlsSocket(proxyHost, proxyPort, targetHost, targetPort, authInfo = null, useTorIsolation = false) {
return new Promise((resolve, reject) => {
const socket = net.connect(proxyPort, proxyHost, () => {
if (useTorIsolation || authInfo) {
socket.write(Buffer.from([0x05, 0x01, 0x02]));
} else {
socket.write(Buffer.from([0x05, 0x01, 0x00]));
}
});
socket.once("data", (data) => {
if (data[0] !== 0x05) {
socket.destroy();
return reject(new Error("Handshake SOCKS5 gagal."));
}
if (data[1] === 0x02) {
let user, pass;
if (useTorIsolation) {
user = "tor_" + Date.now() + "_" + Math.random().toString(36).slice(2, 6);
pass = "pass_" + Math.random().toString(36).slice(2, 6);
} else if (authInfo) {
user = authInfo.user || "";
pass = authInfo.pass || "";
}
const userBuf = Buffer.from(user || "anonymous", "utf8");
const passBuf = Buffer.from(pass || "nopass", "utf8");
const authReq = Buffer.concat([
Buffer.from([0x01, userBuf.length]),
userBuf,
Buffer.from([passBuf.length]),
passBuf
]);
socket.write(authReq);
socket.once("data", (authReply) => {
if (authReply[1] !== 0x00) {
socket.destroy();
return reject(new Error("Autentikasi SOCKS5 gagal: " + authReply[1]));
}
sendConnectCommand();
});
} else if (data[1] === 0x00) {
sendConnectCommand();
} else {
socket.destroy();
return reject(new Error("Metode auth SOCKS5 tidak didukung: " + data[1]));
}
});
function sendConnectCommand() {
const hostBuf = Buffer.from(targetHost, "utf8");
const portBuf = Buffer.alloc(2);
portBuf.writeUInt16BE(targetPort, 0);
const connReq = Buffer.concat([
Buffer.from([0x05, 0x01, 0x00, 0x03, hostBuf.length]),
hostBuf,
portBuf
]);
socket.write(connReq);
socket.once("data", (connReply) => {
if (connReply[1] !== 0x00) {
socket.destroy();
return reject(new Error("Koneksi SOCKS5 tujuan gagal: " + connReply[1]));
}
const tlsSocket = tls.connect({
socket,
servername: targetHost,
rejectUnauthorized: true
}, () => resolve(tlsSocket));
tlsSocket.on("error", (err) => {
socket.destroy();
reject(err);
});
});
}
socket.on("error", reject);
});
}
/**
* Native HTTP CONNECT TLS Socket Handler
*/
function createHttpConnectTlsSocket(proxyHost, proxyPort, targetHost, targetPort, auth = null) {
return new Promise((resolve, reject) => {
const socket = net.connect(proxyPort, proxyHost, () => {
let connectReq = `CONNECT ${targetHost}:${targetPort} HTTP/1.1\r\nHost: ${targetHost}:${targetPort}\r\n`;
if (auth) {
connectReq += `Proxy-Authorization: Basic ${Buffer.from(auth).toString("base64")}\r\n`;
}
connectReq += "\r\n";
socket.write(connectReq);
});
socket.once("data", (data) => {
const resStr = data.toString("utf8");
if (resStr.includes("200 Connection established") || resStr.includes(" 200 ")) {
const tlsSocket = tls.connect({
socket,
servername: targetHost,
rejectUnauthorized: true
}, () => resolve(tlsSocket));
tlsSocket.on("error", (err) => {
socket.destroy();
reject(err);
});
} else {
socket.destroy();
reject(new Error("HTTP Proxy CONNECT failed: " + resStr.split("\r\n")[0]));
}
});
socket.on("error", reject);
});
}
function parseProxyUrl(proxyUrlStr) {
if (!proxyUrlStr) return null;
try {
const parsed = new URL(proxyUrlStr.includes("://") ? proxyUrlStr : `http://${proxyUrlStr}`);
const protocol = parsed.protocol.replace(":", "").toLowerCase();
const isSocks = protocol.startsWith("socks");
const host = parsed.hostname;
const port = parseInt(parsed.port, 10) || (isSocks ? 1080 : 8080);
const auth = parsed.username ? `${parsed.username}:${parsed.password}` : null;
const authInfo = parsed.username ? { user: parsed.username, pass: parsed.password } : null;
return { protocol, isSocks, host, port, auth, authInfo };
} catch (_) {
return null;
}
}
function buildMultipartFormData(fields, files = []) {
const boundary = "----WebKitFormBoundary" + Math.random().toString(36).slice(2) + Date.now().toString(36);
const parts = [];
for (const [key, val] of Object.entries(fields)) {
if (val !== undefined && val !== null) {
parts.push(
Buffer.from(
`--${boundary}\r\nContent-Disposition: form-data; name="${key}"\r\n\r\n${val}\r\n`
)
);
}
}
for (const file of files) {
const filename = file.filename || "image.jpg";
const mime = file.mime || "image/jpeg";
const header = Buffer.from(
`--${boundary}\r\nContent-Disposition: form-data; name="${file.name}"; filename="${filename}"\r\nContent-Type: ${mime}\r\n\r\n`
);
parts.push(header);
parts.push(file.buffer);
parts.push(Buffer.from("\r\n"));
}
parts.push(Buffer.from(`--${boundary}--\r\n`));
const body = Buffer.concat(parts);
return {
boundary,
body,
contentType: `multipart/form-data; boundary=${boundary}`,
contentLength: body.length
};
}
/**
* Eksekusi HTTP Request ke DeepAI
*/
async function sendDeepAIRequest(fields, files, options = {}) {
const apiKey = options.apiKey || generateTryitApiKey(options.userAgent || DEFAULT_UA);
const uuid = crypto.randomUUID();
const ua = options.userAgent || DEFAULT_UA;
const { body, contentType, contentLength } = buildMultipartFormData(fields, files);
const headers = {
"api-key": apiKey,
"user-agent": ua,
"origin": "https://deepai.org",
"referer": "https://deepai.org/",
"cookie": `_axwrt=${uuid}; _axwrt_ts=${uuid}.${Date.now()}`,
"Content-Type": contentType,
"Content-Length": contentLength
};
const customProxy = options.proxy || process.env.DEEPAI_PROXY;
let createConnection;
if (customProxy) {
const p = parseProxyUrl(customProxy);
if (p) {
createConnection = async () => {
if (p.isSocks) {
return await createSocks5TlsSocket(p.host, p.port, "api.deepai.org", 443, p.authInfo, false);
} else {
return await createHttpConnectTlsSocket(p.host, p.port, "api.deepai.org", 443, p.auth);
}
};
}
} else if (options.useTor !== false) {
const torActive = await isPortOpen("127.0.0.1", 9050);
if (torActive) {
createConnection = async () => {
return await createSocks5TlsSocket("127.0.0.1", 9050, "api.deepai.org", 443, null, true);
};
}
}
return new Promise(async (resolve, reject) => {
try {
let connSocket;
if (createConnection) {
connSocket = await createConnection();
}
const req = https.request({
hostname: "api.deepai.org",
port: 443,
path: "/api/image-editor",
method: "POST",
createConnection: connSocket ? () => connSocket : undefined,
headers,
timeout: 45000
}, (res) => {
let rawData = "";
res.on("data", chunk => rawData += chunk);
res.on("end", () => {
try {
const parsed = JSON.parse(rawData);
resolve({ statusCode: res.statusCode, data: parsed });
} catch (_) {
resolve({ statusCode: res.statusCode, raw: rawData });
}
});
});
req.on("error", reject);
req.on("timeout", () => {
req.destroy();
reject(new Error("Request timeout ke DeepAI API."));
});
req.write(body);
req.end();
} catch (err) {
reject(err);
}
});
}
/**
* Main Controller
* @param {string|Buffer} imageInput
* @param {string} promptText
* @param {object} [options]
* @returns {Promise<object>}
*/
async function editImageWithDeepAI(imageInput, promptText, options = {}) {
const prompt = String(promptText || "").trim();
if (!prompt) {
throw new Error("Instruksi edit (prompt) wajib diisi.");
}
const resolved = await resolveImageInput(imageInput);
const fields = { text: prompt };
const files = [];
if (resolved.type === "url") {
fields.image = resolved.value;
} else if (resolved.type === "buffer") {
files.push({
name: "image",
buffer: resolved.buffer,
filename: resolved.filename,
mime: resolved.mime
});
}
const proApiKey = options.apiKey || process.env.DEEPAI_API_KEY;
// 1. Mode Direct Pro jika API Key resmi tersedia
if (proApiKey) {
const res = await sendDeepAIRequest(fields, files, {
apiKey: proApiKey,
useTor: false
});
if (res.statusCode === 200 && res.data && (res.data.output_url || res.data.id)) {
return {
status: true,
creator: "Vamz Spectre",
model: MODEL_ID,
mode: "direct_pro",
data: {
id: res.data.id || null,
output_url: res.data.output_url,
prompt
}
};
}
const errMsg = res.data?.status || res.data?.err || `Status ${res.statusCode}`;
throw new Error(`DeepAI Pro Error: ${errMsg}`);
}
// 2. Free Bypass Mode dengan Circuit / Proxy Rotation
const maxRetries = options.proxy ? 2 : 6;
let lastError = null;
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
const res = await sendDeepAIRequest(fields, files, options);
if (res.statusCode === 200 && res.data && (res.data.output_url || res.data.id)) {
return {
status: true,
creator: "Vamz Spectre",
model: MODEL_ID,
mode: options.proxy ? "custom_proxy_bypass" : "free_tor_bypass",
data: {
id: res.data.id || null,
output_url: res.data.output_url,
prompt
}
};
}
const statusMsg = String(res.data?.status || res.data?.err || res.raw || "");
if (
statusMsg.includes("quota exceeded") ||
statusMsg.includes("exceeded") ||
statusMsg.includes("Please try this model on deepai.org") ||
res.statusCode === 401
) {
lastError = new Error(`DeepAI Limit/Edge Filter (${statusMsg}), memutar circuit IP baru...`);
await new Promise(r => setTimeout(r, 1000));
continue;
}
throw new Error(`DeepAI Error (${res.statusCode}): ${statusMsg || JSON.stringify(res.data)}`);
} catch (err) {
lastError = err;
await new Promise(r => setTimeout(r, 1000));
}
}
throw new Error(
`Gagal memproses setelah ${maxRetries} percobaan (${lastError?.message || "Unknown error"}). ` +
`Tips: Jika 127.0.0.1 (Tor) sedang banyak diblokir Cloudflare edge, gunakan custom proxy: node deepai-image-editor.js "img" "prompt" --proxy "http://host:port"`
);
}
// CLI Runner (1:1 Output Konsisten JSON)
if (require.main === module) {
const args = process.argv.slice(2);
let inputImg = null;
let inputPrompt = null;
let customProxy = null;
for (let i = 0; i < args.length; i++) {
if (args[i] === "--proxy" && args[i + 1]) {
customProxy = args[i + 1];
i++;
} else if (!inputImg) {
inputImg = args[i];
} else if (!inputPrompt) {
inputPrompt = args[i];
}
}
if (!inputImg || !inputPrompt) {
console.log(JSON.stringify({
status: false,
creator: "Vamz Spectre",
message: "Penggunaan: node deepai-image-editor.js <image_path_or_url> <edit_prompt> [--proxy <proxy_url>]",
example: 'node deepai-image-editor.js "https://images.deepai.org/machine-learning-models/ba25fbba57eb410e9e2038b78eac5d9a/f078fe461c9c4046be4d810e9e4bb798.webp" "make it sunset with bright warm lighting"'
}, null, 2));
process.exit(1);
}
editImageWithDeepAI(inputImg, inputPrompt, { proxy: customProxy })
.then(result => {
console.log(JSON.stringify(result, null, 2));
})
.catch(err => {
console.error(JSON.stringify({
status: false,
creator: "Vamz Spectre",
error: err.message || String(err)
}, null, 2));
process.exit(1);
});
}
module.exports = {
editImageWithDeepAI,
generateTryitApiKey,
sendDeepAIRequest,
createSocks5TlsSocket,
createHttpConnectTlsSocket
};