AIjavascript345
Dola AI - ByteDance Chatbot Engine & Multi-Account Rotator
Dola AI (ByteDance / Doubao International) chat completion scraper and reverse-engineered client. Features multi-account session pooling (auto-rotation), conversation memory, SSE stream response extraction, and unlimited text generation capability.
Vamz Spectre14 Okt 2026252 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/dola-ai" -o dola-ai.js
# 2. Jalankan script
node dola-ai.js
Dependencies npm yang Dibutuhkan:
npm install axiosPanduan Penggunaan:
node dola-ai.js "Halo siapa kamu?" "YOUR_SESSION_ID"
dola-ai.js(252 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
/**
* ========================================================
* Name: Dola AI - ByteDance Chatbot Engine & Multi-Account Rotator
*
* Cara Download:
* curl -sL "https://code.vamxapi.my.id/snippet/raw/dola-ai" -o dola-ai.js
*
* Cara Eksekusi:
* node dola-ai.js "Halo siapa kamu?"
* node dola-ai.js "Jelaskan tentang AI" "sessionid_kamu"
*
* Panduan Ambil Cookie / Session ID:
* 1. Buka browser dan login ke https://www.dola.com/chat/
* 2. Tekan F12 -> tab Application / Storage -> Cookies -> https://www.dola.com
* 3. Salin isi value dari cookie "sessionid" (atau "sessionid_ss")
* 4. Masukkan ke array SESSIONS_POOL di bawah ini (bisa 1 akun atau banyak akun).
*
* Author: Vamz Spectre
* Source: https://vamxapi.my.id
* ========================================================
*/
const axios = require("axios");
const crypto = require("crypto");
// Pool Session Akun Dola (Isi 1 akun atau banyak akun untuk auto-rotasi / bypass limit)
const SESSIONS_POOL = [
process.env.DOLA_SESSION_ID || "",
// "sessionid_akun_2",
// "sessionid_akun_3"
].filter(Boolean);
let currentSessionIndex = 0;
function getNextSession(customSession = null) {
if (customSession && typeof customSession === "string" && customSession.trim()) {
return customSession.trim();
}
if (SESSIONS_POOL.length === 0) {
return "";
}
const session = SESSIONS_POOL[currentSessionIndex % SESSIONS_POOL.length];
currentSessionIndex++;
return session;
}
function parseSSEStream(sseText) {
let replyText = "";
let metaAck = null;
const lines = sseText.split("\n");
let currentEvent = null;
for (const line of lines) {
if (line.startsWith("event:")) {
currentEvent = line.slice(6).trim();
} else if (line.startsWith("data:")) {
const dataStr = line.slice(5).trim();
if (dataStr && dataStr !== "{}") {
try {
const parsed = JSON.parse(dataStr);
if (currentEvent === "STREAM_ERROR") {
throw new Error(parsed.error_msg || "Stream Error dari Dola");
}
if (currentEvent === "SSE_ACK") {
metaAck = parsed?.ack_client_meta || null;
}
if (currentEvent === "STREAM_MSG_NOTIFY" || currentEvent === "STREAM_CHUNK") {
const blocks = parsed?.content?.content_block || [];
for (const b of blocks) {
const t = b?.content?.text_block?.text;
if (t) replyText += t;
}
const patchOps = parsed?.patch_op || [];
for (const op of patchOps) {
const pBlocks = op?.patch_value?.content_block || [];
for (const b of pBlocks) {
const t = b?.content?.text_block?.text;
if (t) replyText += t;
}
}
}
} catch (e) {
if (e.message.includes("Stream Error") || e.message.includes("login invalid")) {
throw e;
}
}
}
currentEvent = null;
}
}
return { text: replyText, meta: metaAck };
}
/**
* Chat dengan Dola AI (ByteDance Seed LLM)
* @param {string} prompt - Pertanyaan / prompt teks
* @param {Object|string} options - Opsi sesi / sessionid / conversation_id
* @returns {Promise<Object>}
*/
async function dolaChat(prompt, options = {}) {
if (!prompt || typeof prompt !== "string") {
throw new Error("Parameter prompt wajib diisi string teks yang valid!");
}
const session = typeof options === "string" ? options : (options.session || getNextSession());
const conversationId = typeof options === "object" ? (options.conversationId || "") : "";
const botId = typeof options === "object" ? (options.botId || "7241547611541340167") : "7241547611541340167";
const payload = {
client_meta: {
bot_id: botId,
conversation_id: conversationId,
history_message_list: [],
last_message_index: 0,
last_section_id: "",
local_conversation_id: crypto.randomUUID(),
local_onboarding_message_id: "",
scene_type: 0,
section_id: ""
},
messages: [
{
content_block: [
{
append_fields: [],
block_id: crypto.randomUUID(),
block_type: 10000,
content: {
text_block: {
text: prompt.trim(),
text_block_scene: 0
}
},
is_finish: false,
meta_info: [],
parent_id: ""
}
],
local_message_id: crypto.randomUUID(),
message_specific_ext: {
before_content_type: 1,
send_message_scene: "keyboard"
},
message_status: 0
}
],
option: {
need_ack_conversation: true
}
};
const headers = {
"Content-Type": "application/json",
"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",
"Referer": "https://www.dola.com/chat/",
"Origin": "https://www.dola.com"
};
if (session) {
headers["Cookie"] = session.includes("=") ? session : `sessionid=${session}; sessionid_ss=${session}`;
}
try {
const response = await axios.post("https://www.dola.com/chat/completion", payload, {
headers,
responseType: "text",
timeout: 45000
});
const parsed = parseSSEStream(response.data);
if (!parsed.text) {
if (response.data.includes("login invalid")) {
return {
status: false,
creator: "Vamz Spectre",
message: "Session ID Dola tidak valid atau telah kedaluwarsa. Silakan perbarui cookie sessionid akun Anda.",
errorCode: "LOGIN_INVALID"
};
}
return {
status: false,
creator: "Vamz Spectre",
message: "Respon dari Dola kosong atau terputus.",
raw: response.data.slice(0, 300)
};
}
return {
status: true,
creator: "Vamz Spectre",
result: {
prompt: prompt.trim(),
reply: parsed.text.trim(),
conversationId: parsed.meta?.conversation_id || conversationId,
sectionId: parsed.meta?.section_id || null,
botId: botId
}
};
} catch (error) {
const errMsg = error.response?.data || error.message;
if (typeof errMsg === "string" && errMsg.includes("login invalid")) {
return {
status: false,
creator: "Vamz Spectre",
message: "Session login diperlukan. Masukkan sessionid akun Anda ke SESSIONS_POOL atau via parameter.",
errorCode: "NEED_LOGIN"
};
}
return {
status: false,
creator: "Vamz Spectre",
message: error.message || "Terjadi kesalahan saat menghubungi Dola AI."
};
}
}
module.exports = { dolaChat, SESSIONS_POOL };
async function runCli() {
const promptArg = process.argv[2];
const sessionArg = process.argv[3];
if (!promptArg) {
console.error(
JSON.stringify(
{
status: false,
creator: "Vamz Spectre",
message: "Gunakan perintah: node dola-ai.js \"<prompt>\" [sessionid]",
example: "node dola-ai.js \"Siapa kamu?\" \"YOUR_SESSION_ID\""
},
null,
2
)
);
process.exit(1);
}
const res = await dolaChat(promptArg, sessionArg);
console.log(JSON.stringify(res, null, 2));
}
if (require.main === module || process.argv[1]?.includes("dola-ai.js")) {
runCli().catch((err) => {
console.error(JSON.stringify({ status: false, error: err.message }, null, 2));
process.exit(1);
});
}