scraperjavascript26237
Nimegami - Anime Sub Indo Scraper & Direct Video Stream Extractor
Scraper nimegami.id untuk rilis terbaru, katalog anime, pencarian lengkap & saran otomatis, detail anime, batch/per-episode download mirrors (BerkasDrive/Send), serta ekstraksi direct video streaming MP4 kualitas 360p-1080p.
Vamz Spectre14 Nov 2026477 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/nimegami" -o nimegami.js
# 2. Jalankan script
node nimegami.js
Dependencies npm yang Dibutuhkan:
npm install axios, cheerioPanduan Penggunaan:
curl -sL "https://code.vamxapi.my.id/snippet/raw/nimegami" -o nimegami.js node nimegami.js "latest" node nimegami.js "search" "bleach" node nimegami.js "detail" "bleach-sennen-kessen-hen-sub-indo" node nimegami.js "stream" "bleach-sennen-kessen-hen-sub-indo" 1 "720p"
nimegami.js(477 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
/**
* Nimegami.id Scraper & Direct Video Stream Extractor
* Author: Vamz Spectre / VamxAPI
* Target: https://nimegami.id
*
* Download:
* curl -sL "https://code.vamxapi.my.id/snippet/raw/nimegami" -o nimegami.js
*
* Usage:
* node nimegami.js "latest"
* node nimegami.js "list" 1
* node nimegami.js "search" "bleach"
* node nimegami.js "detail" "bleach-sennen-kessen-hen-sub-indo"
* node nimegami.js "stream" "bleach-sennen-kessen-hen-sub-indo" 1 "720p"
*/
const axios = require("axios");
const cheerio = require("cheerio");
const BASE_URL = "https://nimegami.id";
const DEFAULT_HEADERS = {
"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",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"Accept-Language": "id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7",
};
/**
* Format relative image URL to absolute URL
*/
function resolveUrl(url) {
if (!url) return null;
if (url.startsWith("http://") || url.startsWith("https://")) return url;
if (url.startsWith("/")) return `${BASE_URL}${url}`;
return `${BASE_URL}/${url}`;
}
/**
* Clean slug string
*/
function cleanSlug(str) {
if (!str) return "";
return str
.replace(/^https?:\/\/[^\/]+/, "")
.replace(/^\//, "")
.replace(/\/$/, "");
}
/**
* Parse anime card element
*/
function parseCard($, el) {
const $el = $(el);
const cardTitle = $el.find(".card-title");
const title = cardTitle.text().trim();
const rawHref = cardTitle.attr("href") || $el.find(".poster-link").attr("href") || "";
const slug = cleanSlug(rawHref);
let poster = $el.find("img.poster-image, .poster-link img, img").first().attr("src") || null;
if (poster && poster.includes("url=")) {
try {
const match = poster.match(/url=([^&]+)/);
if (match) poster = decodeURIComponent(match[1]);
} catch (_) {}
}
const format = $el.find(".format-badge").text().trim() || null;
const score = $el.find(".score-badge").text().trim() || null;
const lastEpisodeText = $el.find(".card-last-episode").text().replace(/Episode Terakhir:\s*/i, "").trim();
const metaText = $el.find(".card-meta").text().trim();
return {
title,
slug,
url: `${BASE_URL}/${slug}/`,
poster: resolveUrl(poster),
format,
score,
lastEpisode: lastEpisodeText || null,
meta: metaText || null
};
}
/**
* 1. Fetch latest releases (Rilis Terbaru)
*/
async function latest() {
try {
const { data: html } = await axios.get(BASE_URL, {
headers: DEFAULT_HEADERS,
timeout: 10000
});
const $ = cheerio.load(html);
const items = [];
$(".anime-card").each((_, el) => {
const card = parseCard($, el);
if (card.slug && card.title) {
items.push(card);
}
});
return {
status: true,
creator: "Vamz Spectre",
type: "latest",
totalFound: items.length,
anime: items
};
} catch (err) {
return {
status: false,
creator: "Vamz Spectre",
error: err.message || "Failed to fetch latest anime releases"
};
}
}
/**
* 2. Fetch anime catalog list with pagination
*/
async function list(page = 1, sort = "updated") {
try {
const targetUrl = `${BASE_URL}/anime/?sort=${sort}&page=${page}`;
const { data: html } = await axios.get(targetUrl, {
headers: DEFAULT_HEADERS,
timeout: 10000
});
const $ = cheerio.load(html);
const items = [];
$(".anime-card").each((_, el) => {
const card = parseCard($, el);
if (card.slug && card.title) {
items.push(card);
}
});
// Extract pagination total
let totalPages = Number(page);
$("a[href*='page=']").each((_, el) => {
const href = $(el).attr("href") || "";
const match = href.match(/page=(\d+)/);
if (match) {
const p = parseInt(match[1], 10);
if (p > totalPages) totalPages = p;
}
});
return {
status: true,
creator: "Vamz Spectre",
type: "list",
currentPage: Number(page),
totalPages,
totalFound: items.length,
anime: items
};
} catch (err) {
return {
status: false,
creator: "Vamz Spectre",
error: err.message || "Failed to fetch anime catalog"
};
}
}
/**
* 3. Search anime by query
*/
async function search(query) {
try {
const encoded = encodeURIComponent(query);
// Quick suggestion API check
let suggestions = [];
try {
const { data: apiData } = await axios.get(`${BASE_URL}/api/anime-search/?q=${encoded}`, {
headers: DEFAULT_HEADERS,
timeout: 5000
});
if (apiData && Array.isArray(apiData.suggestions)) {
suggestions = apiData.suggestions.map(s => ({
title: s.title,
slug: s.slug,
url: `${BASE_URL}/${s.slug}/`,
poster: resolveUrl(s.poster),
format: s.format,
year: s.year
}));
}
} catch (_) {}
// Full search page
const { data: html } = await axios.get(`${BASE_URL}/anime/?q=${encoded}`, {
headers: DEFAULT_HEADERS,
timeout: 10000
});
const $ = cheerio.load(html);
const items = [];
$(".anime-card").each((_, el) => {
const card = parseCard($, el);
if (card.slug && card.title) {
items.push(card);
}
});
return {
status: true,
creator: "Vamz Spectre",
type: "search",
query,
totalFound: items.length,
suggestions,
anime: items
};
} catch (err) {
return {
status: false,
creator: "Vamz Spectre",
error: err.message || "Failed to search anime"
};
}
}
/**
* 4. Fetch anime detail & downloads
*/
async function detail(slugOrUrl) {
try {
const slug = cleanSlug(slugOrUrl);
const targetUrl = `${BASE_URL}/${slug}/`;
const { data: html } = await axios.get(targetUrl, {
headers: DEFAULT_HEADERS,
timeout: 10000
});
const $ = cheerio.load(html);
const title = $("h1").first().text().trim();
let banner = $("link[as=\"image\"][href*=\"banners\"]").attr("href") || null;
let poster = $("img[src*=\"posters\"]").first().attr("src") || null;
if (poster && poster.includes("url=")) {
try {
const match = poster.match(/url=([^&]+)/);
if (match) poster = decodeURIComponent(match[1]);
} catch (_) {}
}
const synopsis = $(".rich-content").first().text().trim() ||
$("meta[name=\"description\"]").attr("content") || null;
// Extract table info
const info = {};
$(".anime-info dl div").each((_, el) => {
const key = $(el).find("dt").text().trim();
const val = $(el).find("dd").text().trim();
if (key && val) {
const cleanKey = key.toLowerCase()
.replace(/\s+/g, "_")
.replace(/[^a-z0-9_]/g, "");
info[cleanKey] = val;
}
});
// Extract Genres
const genres = [];
$("a[href*=\"/category/\"], a[href*=\"/genre/\"], .genre-badge").each((_, el) => {
const g = $(el).text().trim();
if (g && !genres.includes(g) && g !== "Genre") {
genres.push(g);
}
});
// Extract Batch downloads
const batchDownloads = [];
$(".download-batch-part, .download-batch").each((_, el) => {
const partTitle = $(el).find("h4, .batch-part-title").text().trim() || "Batch Download";
const qualities = [];
$(el).find(".download-row").each((_, row) => {
const quality = $(row).find(".quality-label strong").text().trim();
const mirrors = [];
$(row).find(".download-mirrors a").each((_, a) => {
const href = $(a).attr("href") || "";
mirrors.push({
name: $(a).attr("title") || "Download",
url: resolveUrl(href)
});
});
if (quality && mirrors.length > 0) {
qualities.push({ quality, mirrors });
}
});
if (qualities.length > 0) {
batchDownloads.push({ title: partTitle, qualities });
}
});
// Extract Per-Episode downloads
const episodeDownloads = [];
$("[id^=\"download_episode_\"]").each((_, el) => {
const epId = $(el).attr("id") || "";
const epNum = epId.replace(/^download_episode_/, "");
const epTitle = $(el).find("h3, h4, .download-per-episode-header").text().trim() || `Episode ${epNum}`;
const qualities = [];
$(el).find(".download-row").each((_, row) => {
const quality = $(row).find(".quality-label strong").text().trim();
const mirrors = [];
$(row).find(".download-mirrors a").each((_, a) => {
const href = $(a).attr("href") || "";
const name = $(a).attr("title") || "Download";
mirrors.push({
name,
url: resolveUrl(href)
});
});
if (quality && mirrors.length > 0) {
qualities.push({ quality, mirrors });
}
});
episodeDownloads.push({
episode: epNum,
title: epTitle,
qualities
});
});
return {
status: true,
creator: "Vamz Spectre",
result: {
title,
slug,
url: targetUrl,
poster: resolveUrl(poster),
banner: resolveUrl(banner),
synopsis,
genres,
info,
batchDownloads,
episodeDownloads
}
};
} catch (err) {
return {
status: false,
creator: "Vamz Spectre",
error: err.message || "Failed to fetch anime detail"
};
}
}
/**
* 5. Extract direct MP4 streaming video URL
*/
async function stream(slugOrUrl, episode = "1", preferredQuality = "720p") {
try {
const slug = cleanSlug(slugOrUrl);
// First fetch detail to find streaming mediaId for episode
const detailData = await detail(slug);
if (!detailData.status) throw new Error(detailData.error);
const ep = detailData.result.episodeDownloads.find(e => String(e.episode) === String(episode)) ||
detailData.result.episodeDownloads[0];
if (!ep) {
throw new Error(`Episode ${episode} not found for ${slug}`);
}
// Find quality mirror
let matchedQuality = ep.qualities.find(q => q.quality.toLowerCase() === preferredQuality.toLowerCase()) ||
ep.qualities[0];
if (!matchedQuality || !matchedQuality.mirrors || matchedQuality.mirrors.length === 0) {
throw new Error(`No mirror available for episode ${episode}`);
}
// Extract mediaId from download URL: /bleach-sennen-kessen-hen-sub-indo/download/1/720p/293009a7-5411-4a18-96d8-444a84754f54/
const dlUrl = matchedQuality.mirrors[0].url;
const mediaIdMatch = dlUrl.match(/\/download\/\d+\/[^\/]+\/([a-f0-9\-]+)/);
const mediaId = mediaIdMatch ? mediaIdMatch[1] : null;
if (!mediaId) {
throw new Error(`Could not extract mediaId from mirror URL: ${dlUrl}`);
}
const streamPageUrl = `${BASE_URL}/${slug}/streaming/${episode}/${matchedQuality.quality}/${mediaId}/`;
const { data: html } = await axios.get(streamPageUrl, {
headers: DEFAULT_HEADERS,
timeout: 10000
});
const $ = cheerio.load(html);
const player = $("#player");
const streamUrl = player.attr("data-src") || null;
const streamTitle = player.attr("data-title") || null;
// Available quality options on player
const availableQualities = [];
$(".quality-option").each((_, el) => {
const qUrl = $(el).attr("data-quality-url");
const mId = $(el).attr("data-media-id");
const resMatch = (qUrl || "").match(/\/streaming\/\d+\/([^\/]+)\//);
const quality = resMatch ? resMatch[1] : $(el).text().replace(/[^0-9p]/gi, "");
if (qUrl) {
availableQualities.push({
quality,
mediaId: mId,
url: resolveUrl(qUrl)
});
}
});
return {
status: true,
creator: "Vamz Spectre",
result: {
anime: detailData.result.title,
slug,
episode: Number(episode),
quality: matchedQuality.quality,
title: streamTitle,
mediaId,
streamUrl,
availableQualities
}
};
} catch (err) {
return {
status: false,
creator: "Vamz Spectre",
error: err.message || "Failed to extract video stream"
};
}
}
// Module Exports
module.exports = {
latest,
list,
search,
detail,
stream
};
// CLI Execution Runner
if (require.main === module) {
(async () => {
const action = process.argv[2] ? process.argv[2].trim() : "latest";
const param1 = process.argv[3] ? process.argv[3].trim() : "";
const param2 = process.argv[4] ? process.argv[4].trim() : "";
const param3 = process.argv[5] ? process.argv[5].trim() : "";
let res;
if (action === "latest" || action === "home") {
res = await latest();
} else if (action === "list" || action === "catalog") {
res = await list(param1 || 1, param2 || "updated");
} else if (action === "search") {
res = await search(param1 || "naruto");
} else if (action === "detail") {
res = await detail(param1 || "bleach-sennen-kessen-hen-sub-indo");
} else if (action === "stream") {
res = await stream(param1 || "bleach-sennen-kessen-hen-sub-indo", param2 || "1", param3 || "720p");
} else if (action.includes("-sub-indo") || action.includes("http")) {
res = await detail(action);
} else {
res = await search(action);
}
console.log(JSON.stringify(res, null, 2));
})();
}