scraperjavascript297
Zxko Minecraft Bedrock Scraper (Mods, Textures, Skins, Worlds)
Scraper serbaguna untuk platform Zxko.site guna mengambil data dan direct download link Minecraft Bedrock: Add-ons (Mod), Textures, Skins, dan Maps (World).
Vamz Spectre3 Okt 2026246 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/zxko-minecraft-scraper" -o zxko-minecraft-scraper.js
# 2. Jalankan script
node zxko-minecraft-scraper.js
Dependencies npm yang Dibutuhkan:
npm install axiosPanduan Penggunaan:
// 1. Instalasi Dependencies:
npm install axios
// 2. Eksekusi Cepat via CLI:
node zxko-minecraft-scraper.js --category mod --limit 5
node zxko-minecraft-scraper.js --category texture --limit 5
node zxko-minecraft-scraper.js --category skin --limit 5
node zxko-minecraft-scraper.js --category world --limit 5
node zxko-minecraft-scraper.js --search "One Block"
node zxko-minecraft-scraper.js --detail "Transformers"
// 3. Penggunaan Modular di Node.js:
const { scrapeZxko, searchZxko, getZxkoDetail } = require(./zxko-minecraft-scraper);
// Ambil kumpulan Add-ons / Mod
const mods = await scrapeZxko('mod', { limit: 10 });
console.log(mods.results);
// Cari texture pack atau map tertentu
const search = await searchZxko('One Block', 5);
console.log(search.results);
// 4. Implementasi Bot WhatsApp (Baileys):
case 'mcmod':
case 'mcaddon': {
const query = text || 'Transformers';
const { results } = await searchZxko(query, 1);
if (!results.length) return m.reply('❌ Addon/Mod Minecraft tidak ditemukan.');
const item = results[0];
const caption = `🎮 *${item.name}* (${item.category})
` +
`📦 Ukuran: ${item.file_size_formatted}
` +
`📥 Download: ${item.download_url}
` +
`${item.description}`;
await sock.sendMessage(m.chat, {
image: { url: item.thumbnail },
caption
}, { quoted: m });
break;
}zxko-minecraft-scraper.js(246 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
/**
* Zxko.site Minecraft Bedrock Scraper Engine
* Scrapes: Mods (Add-ons), Textures, Skins, and Worlds (Maps)
* Target: https://zxko.site
* Author: Vamz Spectre
* License: MIT
*
* Fitur:
* - Scrape konten Minecraft Bedrock: Add-ons (Mod), Textures, Skins, & Maps (World)
* - Pencarian cepat cerdas (Smart Search)
* - Ekstraksi detail item lengkap (banner, screenshot, file size, direct download URL)
* - Direct download link resmi (.mcaddon, .mcpack, .mctemplate)
* - Dukungan eksekusi CLI dan integrasi modular bot WhatsApp (Baileys)
*/
const axios = require("axios");
const BASE_URL = "https://zxko.site";
const CATEGORY_MAP = {
mod: "Add-ons",
mods: "Add-ons",
addon: "Add-ons",
addons: "Add-ons",
"add-ons": "Add-ons",
texture: "Textures",
textures: "Textures",
skin: "Skins",
skins: "Skins",
world: "Maps",
worlds: "Maps",
map: "Maps",
maps: "Maps",
};
/**
* Normalisasi nama kategori input ke format resmi Zxko
*/
function normalizeCategory(category) {
if (!category) return "Add-ons";
const lower = String(category).toLowerCase().trim();
return CATEGORY_MAP[lower] || category;
}
/**
* Format ukuran byte ke string human-readable (KB, MB, GB)
*/
function formatBytes(bytes) {
if (!bytes || isNaN(bytes)) return "0 B";
const num = Number(bytes);
const units = ["B", "KB", "MB", "GB"];
const i = Math.floor(Math.log(num) / Math.log(1024));
return `${(num / Math.pow(1024, i)).toFixed(2)} ${units[i]}`;
}
/**
* Merapikan struktur data mod / addon / skin / texture / world
*/
function cleanModItem(m) {
return {
id: m.id,
name: m.name,
category: m.category,
slug: m.name
? m.name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "")
: m.id,
short_code: m.short_code || null,
description: m.description ? m.description.trim() : "",
download_count: m.download_count || 0,
file_name:
m.mod_file_name ||
(m.mod_file_url ? decodeURIComponent(m.mod_file_url.split("/").pop() || "") : null),
file_size: m.mod_file_size ? Number(m.mod_file_size) : null,
file_size_formatted: m.mod_file_size ? formatBytes(m.mod_file_size) : null,
download_url: m.mod_file_url || null,
thumbnail: m.main_image_url || null,
banner: m.banner_image_url || null,
secondary_images: Array.isArray(m.secondary_images) ? m.secondary_images : [],
video_url: m.video_url || null,
marketplace_url: m.marketplace_url || null,
created_at: m.created_at || null,
};
}
/**
* Mengambil daftar konten berdasarkan kategori (mod, texture, skin, world)
* @param {string} category - 'mod' | 'texture' | 'skin' | 'world'
* @param {object} options - { page: 1, limit: 16 }
*/
async function scrapeZxkoByCategory(category = "mod", options = {}) {
const cat = normalizeCategory(category);
const page = Math.max(1, Number(options.page) || 1);
const limit = Math.max(1, Math.min(100, Number(options.limit) || 16));
const url = `${BASE_URL}/api/mods/by-category?category=${encodeURIComponent(cat)}&limit=${limit}&page=${page}`;
const res = await axios.get(url, {
headers: {
"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",
Referer: "https://zxko.site/",
},
timeout: 15000,
});
const rawMods = res.data?.mods || [];
return {
status: true,
category: cat,
page,
limit,
total_returned: rawMods.length,
results: rawMods.map(cleanModItem),
};
}
/**
* Mencari item (Addon, Texture, Skin, World) berdasarkan kata kunci
* @param {string} query - Kata kunci pencarian
* @param {number} limit - Jumlah maksimal hasil (default: 16)
*/
async function searchZxko(query, limit = 16) {
if (!query || !String(query).trim()) {
throw new Error("Kata kunci pencarian tidak boleh kosong");
}
const url = `${BASE_URL}/api/mods/smart-search?q=${encodeURIComponent(String(query).trim())}`;
const res = await axios.get(url, {
headers: {
"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",
Referer: "https://zxko.site/",
},
timeout: 15000,
});
const rawMods = res.data?.mods || [];
return {
status: true,
query: String(query).trim(),
total_returned: rawMods.length,
results: rawMods.slice(0, limit).map(cleanModItem),
};
}
/**
* Mendapatkan detail lengkap item berdasarkan slug atau short_code
* @param {string} slugOrCode - Nama/slug atau kode pendek item
*/
async function getZxkoDetail(slugOrCode) {
if (!slugOrCode || !String(slugOrCode).trim()) {
throw new Error("Slug atau kode item wajib diisi");
}
const target = encodeURIComponent(String(slugOrCode).trim());
let url = `${BASE_URL}/api/mods/by-slug/${target}`;
try {
const res = await axios.get(url, {
headers: {
"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",
Referer: "https://zxko.site/",
},
timeout: 15000,
});
if (res.data?.mod) {
return { status: true, result: cleanModItem(res.data.mod) };
}
} catch {}
// Fallback ke pencarian by-code
url = `${BASE_URL}/api/mods/by-code/${target}`;
const res = await axios.get(url, {
headers: {
"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",
Referer: "https://zxko.site/",
},
timeout: 15000,
});
if (res.data?.mod) {
return { status: true, result: cleanModItem(res.data.mod) };
}
throw new Error("Konten Minecraft tidak ditemukan di Zxko.");
}
if (typeof module !== "undefined" && module.exports) {
module.exports = {
scrapeZxko: scrapeZxkoByCategory,
scrapeZxkoByCategory,
searchZxko,
getZxkoDetail,
};
}
// CLI Execution Handler
const isCLI =
require.main === module ||
!require.main ||
process.argv[1] === "-" ||
process.argv[1] === "[stdin]";
if (isCLI) {
const args = process.argv.slice(2);
const getArg = (flag) => {
const idx = args.indexOf(flag);
return idx !== -1 && args[idx + 1] ? args[idx + 1] : null;
};
const category = getArg("--category") || getArg("-c");
const search = getArg("--search") || getArg("-s");
const detail = getArg("--detail") || getArg("-d");
const limit = parseInt(getArg("--limit") || "10", 10);
const page = parseInt(getArg("--page") || "1", 10);
async function runCLI() {
console.log("🎮 Zxko Minecraft Bedrock Scraper by Vamz Spectre");
if (detail) {
console.log(`🔍 Mengambil detail untuk: "${detail}"...`);
const res = await getZxkoDetail(detail);
console.log(JSON.stringify(res, null, 2));
return;
}
if (search) {
console.log(`🔍 Mencari "${search}" di Zxko...`);
const res = await searchZxko(search, limit);
console.log(JSON.stringify(res, null, 2));
return;
}
const catToFetch = category || "mod";
console.log(`📦 Mengambil kategori "${catToFetch}" (Halaman: ${page}, Limit: ${limit})...`);
const res = await scrapeZxkoByCategory(catToFetch, { page, limit });
console.log(JSON.stringify(res, null, 2));
}
runCLI().catch((err) => {
console.error("❌ Terjadi Kesalahan:", err.message);
});
}