scraperjavascript405
DongWorld Scraper & Donghua Stream Extractor
Scraper streaming donghua DongWorld (dongworld.top) subtitle Indonesia lengkap dengan pencarian, katalog, sinopsis, list episode, link embed multi-server (Okru, Vkru, Rubyvid), dan download link Google Drive.
Vamz Spectre12 Okt 2026238 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/dongworld-scraper" -o dongworld-scraper.js
# 2. Jalankan script
node dongworld-scraper.js
Dependencies npm yang Dibutuhkan:
npm install https (built-in)Panduan Penggunaan:
Jalankan langsung dengan Node.js v18+: node dongworld.js tanpa perlu install dependency tambahan.
dongworld-scraper.js(238 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
/**
* ========================================================
* Name: DongWorld Scraper & Donghua Stream Extractor
*
* Cara Download:
* curl -sL "https://code.vamxapi.my.id/snippet/raw/dongworld-scraper" -o dongworld-scraper.js
*
* Cara Eksekusi:
* node dongworld-scraper.js "Battle Through The Heavens"
*
* Author: Vamz Spectre
* Source: https://vamxapi.my.id
* ========================================================
*/
async function fetchHtml(urlStr) {
const res = await fetch(urlStr, {
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Accept-Language": "id,en-US;q=0.9,en;q=0.8"
}
});
return await res.text();
}
/**
* 1. SEARCH: Cari Donghua berdasarkan judul
*/
async function searchDonghua(query, page = 1) {
const url = `https://dongworld.top/series?search=${encodeURIComponent(query)}&page=${page}`;
const html = await fetchHtml(url);
const unescaped = html.replace(/\\"/g, "\"");
const cards = [];
const cardRegex = /href="\/series\/([^"]+)"[\s\S]*?alt="([^"]+)"[\s\S]*?src="([^"]+)"[\s\S]*?class="dl-card-title">([^<]+)<[\s\S]*?span>([^<]+eps)<[\s\S]*?fa-star"><\/i>([^<]+)</g;
let m;
const seen = new Set();
while ((m = cardRegex.exec(unescaped)) !== null) {
const slug = m[1];
if (!seen.has(slug)) {
seen.add(slug);
cards.push({
slug,
title: m[4].trim(),
cover: m[3].startsWith("http") ? m[3] : `https://dongworld.top${m[3]}`,
episodes: m[5].replace(/<!-- -->/g, "").trim(),
rating: m[6].trim(),
url: `https://dongworld.top/series/${slug}`
});
}
}
return {
status: true,
query,
page,
totalResults: cards.length,
results: cards
};
}
/**
* 2. KATALOG: Ambil Daftar Semua Donghua
*/
async function getLatestDonghua(page = 1) {
const url = `https://dongworld.top/series?page=${page}`;
const html = await fetchHtml(url);
const unescaped = html.replace(/\\"/g, "\"");
const cards = [];
const cardRegex = /href="\/series\/([^"]+)"[\s\S]*?alt="([^"]+)"[\s\S]*?src="([^"]+)"[\s\S]*?class="dl-card-title">([^<]+)<[\s\S]*?span>([^<]+eps)<[\s\S]*?fa-star"><\/i>([^<]+)</g;
let m;
const seen = new Set();
while ((m = cardRegex.exec(unescaped)) !== null) {
const slug = m[1];
if (!seen.has(slug)) {
seen.add(slug);
cards.push({
slug,
title: m[4].trim(),
cover: m[3].startsWith("http") ? m[3] : `https://dongworld.top${m[3]}`,
episodes: m[5].replace(/<!-- -->/g, "").trim(),
rating: m[6].trim(),
url: `https://dongworld.top/series/${slug}`
});
}
}
return {
status: true,
page,
total: cards.length,
donghua: cards
};
}
/**
* 3. DETAIL: Ambil Detail Donghua, Sinopsis, dan Seluruh Daftar Episode
*/
async function getDonghuaDetail(seriesSlug) {
const url = `https://dongworld.top/series/${seriesSlug}`;
const html = await fetchHtml(url);
const unescaped = html.replace(/\\"/g, "\"");
// Metadata Series
let series = null;
const seriesIdx = unescaped.indexOf('"series":{');
if (seriesIdx !== -1) {
try {
const braceEnd = unescaped.indexOf('}}]}', seriesIdx);
if (braceEnd !== -1) {
series = JSON.parse(unescaped.slice(seriesIdx + 9, braceEnd + 1));
}
} catch (_) {}
}
// Synopsis
let synopsis = "";
const synMatch = unescaped.match(/class="dl-details-synopsis"[\s\S]*?"text":"([^"]+)"/);
if (synMatch) {
synopsis = synMatch[1].replace(/\\n/g, "\n");
}
// Episode List
const episodes = [];
const epRegex = /"episode_number":(\d+),"download_links":null,"slug":"([^"]+)"/g;
let epMatch;
while ((epMatch = epRegex.exec(unescaped)) !== null) {
episodes.push({
episodeNumber: parseInt(epMatch[1], 10),
slug: epMatch[2],
watchUrl: `https://dongworld.top/watch/${epMatch[2]}`
});
}
return {
status: true,
slug: seriesSlug,
title: series?.name || seriesSlug,
rating: series?.rating || null,
statusDonghua: series?.status || null,
genres: series?.genres_string ? series.genres_string.split(", ") : [],
totalEpisodes: episodes.length,
synopsis,
episodes
};
}
/**
* 4. STREAM & DOWNLOAD: Ambil Embed Player & Link Download Google Drive
*/
async function getEpisodeStream(watchSlug) {
const url = `https://dongworld.top/watch/${watchSlug}`;
const html = await fetchHtml(url);
const unescaped = html.replace(/\\"/g, "\"");
// Ekstraksi Embed Stream Links
const links = [];
const linksIdx = unescaped.indexOf('"links":[');
if (linksIdx !== -1) {
try {
const closeIdx = unescaped.indexOf('],"downloads":', linksIdx);
if (closeIdx !== -1) {
const rawJson = unescaped.slice(linksIdx + 8, closeIdx + 1);
const parsed = JSON.parse(rawJson);
parsed.forEach(item => {
links.push({
server: item.server?.name || "Unknown",
url: item.url
});
});
}
} catch (_) {}
}
// Ekstraksi Download Links (Google Drive, dll)
const downloads = [];
const downIdx = unescaped.indexOf('"downloads":[');
if (downIdx !== -1) {
try {
const closeDown = unescaped.indexOf('],"comments":', downIdx);
if (closeDown !== -1) {
const rawDown = unescaped.slice(downIdx + 12, closeDown + 1);
const parsedDown = JSON.parse(rawDown);
parsedDown.forEach(d => {
downloads.push({
server: d.server || "Google Drive",
quality: d.quality || "HD",
link: d.link
});
});
}
} catch (_) {}
}
return {
status: true,
slug: watchSlug,
streamServers: links,
downloadLinks: downloads
};
}
if (typeof module !== "undefined" && module.exports) {
module.exports = { searchDonghua, getDonghuaDetail, getEpisodeStream };
}
/**
* CLI Runner:
* Langsung eksekusi jika dijalankan via terminal: node dongworld-scraper.js "judul"
*/
const argDonghua = process.argv[2];
if (argDonghua) {
(async () => {
try {
if (argDonghua.includes("episode-") || argDonghua.includes("/episode/")) {
const epSlug = argDonghua.split("/").filter(Boolean).pop();
const res = await getEpisodeStream(epSlug);
console.log(JSON.stringify(res, null, 2));
} else if (argDonghua.startsWith("http") || argDonghua.includes("-sub-indo")) {
const seriesSlug = argDonghua.split("/").filter(Boolean).pop();
const res = await getDonghuaDetail(seriesSlug);
console.log(JSON.stringify(res, null, 2));
} else {
const res = await searchDonghua(argDonghua);
console.log(JSON.stringify(res, null, 2));
}
} catch (err) {
console.error(JSON.stringify({ success: false, error: err.message }, null, 2));
process.exit(1);
}
})();
} else if (process.argv[1] && process.argv.length <= 2) {
console.log("Usage: node dongworld-scraper.js \"<judul_donghua>\"");
}