scraperjavascript295
Indowebnovel Scraper - Indonesian Web & Light Novel Reader, Search, Detail & Chapters
Scraper indowebnovel.id lengkap: rilis chapter terbaru, pencarian novel, detail novel & daftar chapter, serta pembaca isi paragraf chapter novel.
Vamz Spectre2 Nov 2026357 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/indowebnovel-scraper" -o indowebnovel-scraper.js
# 2. Jalankan script
node indowebnovel-scraper.js
Dependencies npm yang Dibutuhkan:
npm install axios, cheerioPanduan Penggunaan:
// ========================================== // PANDUAN PENGGUNAAN INDOWEBNOVEL SCRAPER // ========================================== // 1. Download Script via CLI: curl -sL "https://code.vamxapi.my.id/snippet/raw/indowebnovel-scraper" -o indowebnovel-scraper.js // 2. Install Dependensi: npm install axios cheerio // 3. Eksekusi via Terminal: node indowebnovel-scraper.js latest node indowebnovel-scraper.js search "Shadow Slave" node indowebnovel-scraper.js detail "shadow-slave" node indowebnovel-scraper.js chapter "shadow-slave-chapter-3068-tainted-jade-bahasa-indonesia"
indowebnovel-scraper.js(357 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
/**
* Indowebnovel Scraper
* Source: indowebnovel.id
* Author: Vamz Spectre / VamxAPI
*
* Install dependencies:
* npm install axios cheerio
*
* Download via CLI:
* curl -sL "https://code.vamxapi.my.id/snippet/raw/indowebnovel-scraper" -o indowebnovel-scraper.js
*
* Usage Examples:
* node indowebnovel-scraper.js latest
* node indowebnovel-scraper.js search "Shadow Slave"
* node indowebnovel-scraper.js detail "shadow-slave"
* node indowebnovel-scraper.js chapter "shadow-slave-chapter-3068-tainted-jade-bahasa-indonesia"
*/
const axios = require('axios');
const cheerio = require('cheerio');
const BASE_URL = 'https://indowebnovel.id';
const 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 client = axios.create({
baseURL: BASE_URL,
timeout: 15000,
headers: {
'User-Agent': USER_AGENT,
Accept:
'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
'Accept-Language': 'id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7',
},
});
function formatUrl(path) {
if (!path) return '';
if (path.startsWith('http://') || path.startsWith('https://')) return path;
return `${BASE_URL}${path.startsWith('/') ? '' : '/'}${path}`;
}
function cleanSlug(str) {
if (!str) return '';
return str
.replace(/^https?:\/\/[^/]+/i, '')
.replace(/^\/+|\/+$/g, '')
.replace(/^series\//, '')
.trim();
}
/**
* Get latest released novel chapters
* @param {number} page
*/
async function getLatest(page = 1) {
const endpoint = page > 1 ? `/page/${page}/` : '/';
const { data } = await client.get(endpoint);
const $ = cheerio.load(data);
const results = [];
$('.flexbox3-item').each((_, el) => {
const item = $(el);
const title = item.find('.title a').text().trim();
const seriesUrl = item.find('.title a').attr('href') || '';
const img = item.find('.flexbox3-thumb img').attr('src') || '';
const chapters = [];
item.find('.chapter li').each((__, chEl) => {
const chA = $(chEl).find('a');
const chTitle = chA.text().replace(/\s+/g, ' ').trim();
const chUrl = chA.attr('href') || '';
const date = $(chEl).find('.date').text().trim();
if (chUrl) {
chapters.push({
title: chTitle,
url: formatUrl(chUrl),
slug: cleanSlug(chUrl),
date,
});
}
});
if (seriesUrl) {
results.push({
title,
url: formatUrl(seriesUrl),
slug: cleanSlug(seriesUrl),
thumbnail: formatUrl(img),
latestChapters: chapters,
});
}
});
return {
success: true,
page: Number(page),
total: results.length,
data: results,
};
}
/**
* Search novels by keyword
* @param {string} query
* @param {number} page
*/
async function search(query, page = 1) {
if (!query) throw new Error('Query pencarian wajib diisi.');
const endpoint =
page > 1
? `/page/${page}/?s=${encodeURIComponent(query)}`
: `/?s=${encodeURIComponent(query)}`;
const { data } = await client.get(endpoint);
const $ = cheerio.load(data);
const results = [];
$('.flexbox2-item').each((_, el) => {
const item = $(el);
const title =
item.find('.flexbox2-title span').first().text().trim() ||
item.find('a').attr('title')?.trim() ||
'';
const seriesUrl = item.find('a').first().attr('href') || '';
const img = item.find('.flexbox2-thumb img').attr('src') || '';
const type = item.find('.type').text().trim();
const rating = item.find('.score').text().replace(/[^\d.]/g, '').trim();
const synopsis = item.find('.synops p').text().trim();
const genres = [];
item.find('.genres a').each((__, g) => {
const gName = $(g).text().trim();
if (gName) genres.push(gName);
});
if (seriesUrl) {
results.push({
title,
url: formatUrl(seriesUrl),
slug: cleanSlug(seriesUrl),
thumbnail: formatUrl(img),
type,
rating: rating || null,
synopsis,
genres,
});
}
});
return {
success: true,
query,
page: Number(page),
total: results.length,
data: results,
};
}
/**
* Get novel series detail and complete chapter list
* @param {string} slugOrUrl
*/
async function getDetail(slugOrUrl) {
if (!slugOrUrl) throw new Error('Slug atau URL novel wajib diisi.');
const slug = cleanSlug(slugOrUrl);
const { data } = await client.get(`/series/${slug}/`);
const $ = cheerio.load(data);
const title =
$('.series-title h2').text().trim() ||
$('h1.entry-title').text().trim() ||
$('.series-title').text().trim() ||
slug;
const thumbnail =
$('.series-thumb img').attr('src') ||
$('.flexbox-thumb img').attr('src') ||
'';
const synopsis = $('.series-synops, .synops').text().trim();
// Extract info metadata
const metadata = {};
$('.series-infolist li').each((_, el) => {
const key = $(el).find('b').text().replace(/[:\s]+/g, ' ').trim().toLowerCase();
const clone = $(el).clone();
clone.find('b').remove();
const val = clone.text().trim();
if (key && val) {
metadata[key.replace(/\s+/g, '_')] = val;
}
});
// Extract genres
const genres = [];
$('.series-genres a').each((_, el) => {
const g = $(el).text().trim();
if (g) genres.push(g);
});
// Extract chapters list
const chapters = [];
$('ul.series-chapterlists li').each((_, el) => {
const item = $(el);
const chA = item.find('a').clone();
const date = item.find('.date').text().trim();
chA.find('.date').remove();
const chTitle = chA.text().replace(/\s+/g, ' ').trim();
const chUrl = item.find('a').attr('href') || '';
if (chUrl) {
chapters.push({
title: chTitle,
url: formatUrl(chUrl),
slug: cleanSlug(chUrl),
date,
});
}
});
return {
success: true,
title,
thumbnail: formatUrl(thumbnail),
synopsis,
metadata,
genres,
totalChapters: chapters.length,
chapters,
};
}
/**
* Get chapter reading text and navigation
* @param {string} slugOrUrl
*/
async function getChapter(slugOrUrl) {
if (!slugOrUrl) throw new Error('Slug atau URL chapter wajib diisi.');
const slug = cleanSlug(slugOrUrl);
const { data } = await client.get(`/${slug}/`);
const $ = cheerio.load(data);
const title = (
$('h2.title-chapter, h1.entry-title, .title-chapter').first().text() || slug
)
.replace(/\s+/g, ' ')
.trim();
// Navigation
let prevUrl = null;
let nextUrl = null;
let seriesUrl = null;
$('.entry-pagination a, .navi-chapter a').each((_, el) => {
const text = $(el).text().toLowerCase();
const href = $(el).attr('href') || '';
if (text.includes('sebelumnya') && !prevUrl) {
prevUrl = formatUrl(href);
} else if (text.includes('selanjutnya') && !nextUrl) {
nextUrl = formatUrl(href);
} else if (text.includes('daftar isi') && !seriesUrl) {
seriesUrl = formatUrl(href);
}
});
// Clean and extract novel paragraphs
const container = $('div.content').first();
container.find('.ads, script, style, .reader-settings, .title-chapter').remove();
const paragraphs = [];
container.find('p').each((_, el) => {
const text = $(el).text().trim();
if (text) {
paragraphs.push(text);
}
});
return {
success: true,
title,
series: seriesUrl
? {
url: seriesUrl,
slug: cleanSlug(seriesUrl),
}
: null,
navigation: {
prev: prevUrl,
next: nextUrl,
series: seriesUrl,
},
totalParagraphs: paragraphs.length,
content: paragraphs.join('\n\n'),
paragraphs,
};
}
module.exports = {
getLatest,
search,
getDetail,
getChapter,
};
// CLI Runner
if (require.main === module) {
(async () => {
try {
const args = process.argv.slice(2);
const command = (args[0] || 'latest').toLowerCase();
const param = args[1] || '';
let res;
if (command === 'search') {
const query = param || args.slice(1).join(' ') || 'Shadow Slave';
res = await search(query, args[2] || 1);
} else if (command === 'detail') {
const target = param || 'shadow-slave';
res = await getDetail(target);
} else if (command === 'chapter') {
const target =
param ||
'shadow-slave-chapter-3068-tainted-jade-bahasa-indonesia';
res = await getChapter(target);
} else if (command === 'latest') {
res = await getLatest(param || 1);
} else {
// Auto-detect based on input pattern
if (command.includes('-chapter-') || command.includes('chapter-')) {
res = await getChapter(command);
} else if (command.startsWith('http://') || command.startsWith('https://')) {
if (command.includes('/series/')) {
res = await getDetail(command);
} else {
res = await getChapter(command);
}
} else if (args.length > 1) {
res = await search(args.join(' '));
} else {
res = await getDetail(command);
}
}
console.log(JSON.stringify(res, null, 2));
} catch (err) {
console.error(
JSON.stringify(
{
success: false,
error: err.message || 'Terjadi kesalahan pada scraper Indowebnovel.',
},
null,
2
)
);
process.exit(1);
}
})();
}