downloaderjavascript3311
Google Play APK Downloader & Metadata Scraper
High-speed APK downloader and metadata scraper for Google Play Store apps. Extracts direct CDN APK download links, version info, package details, icons, screenshots, and security status.
Vamz Spectre18 Okt 2026216 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/apk-downloader" -o apk-downloader.js
# 2. Jalankan script
node apk-downloader.js
Dependencies npm yang Dibutuhkan:
npm install cheerioPanduan Penggunaan:
curl -sL "https://code.vamxapi.my.id/snippet/raw/apk-downloader" -o apk-downloader.js node apk-downloader.js "https://play.google.com/store/apps/details?id=my.com.tngdigital.ewallet"
apk-downloader.js(216 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
/**
* APK Downloader & Google Play Metadata Scraper
*
* Features:
* - Scrapes Google Play Store app metadata & reviews
* - Resolves direct CDN APK download links with MD5 hash & file size
* - Supports Google Play URLs, direct Package IDs, or app search terms
* - Anti-virus & malware verification status check
* - Zero extra runtime dependencies (pure Node.js 18+ with optional Cheerio support)
*
* Download & Run:
* curl -sL "https://code.vamxapi.my.id/snippet/raw/apk-downloader" -o apk-downloader.js
* node apk-downloader.js "https://play.google.com/store/apps/details?id=my.com.tngdigital.ewallet"
* node apk-downloader.js "my.com.tngdigital.ewallet"
*
* Author: Vamz Spectre / VamxAPI
*/
let cheerio;
try {
cheerio = require("cheerio");
} catch {
// Optional dependency, regex parser fallback included
}
/**
* Format bytes into readable string
* @param {number} bytes
* @returns {string}
*/
function formatBytes(bytes) {
if (!bytes || isNaN(bytes)) return "0 B";
const k = 1024;
const sizes = ["B", "KB", "MB", "GB", "TB"];
const i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
}
/**
* Clean installs count string
* @param {string} raw
* @returns {string}
*/
function cleanInstalls(raw) {
if (!raw) return null;
return raw.replace(/^[0-9.,]+\s*star/i, "").trim() || raw.trim();
}
/**
* Scrape Play Store HTML metadata
* @param {string} packageId
* @returns {Promise<object|null>}
*/
async function scrapePlayStore(packageId) {
try {
const playUrl = `https://play.google.com/store/apps/details?id=${encodeURIComponent(packageId)}&hl=id&gl=ID`;
const res = await fetch(playUrl, {
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",
"Accept-Language": "id-ID,id;q=0.9,en;q=0.8"
}
});
if (!res.ok) return null;
const html = await res.text();
if (cheerio) {
const $ = cheerio.load(html);
const title = $("h1").first().text().trim() || null;
const developer = $("a[href*=\"/store/apps/developer?id=\"]").first().text().trim() ||
$("a[href*=\"/store/apps/dev?id=\"]").first().text().trim() || null;
let rating = ($("[itemprop=\"starRating\"]").text().trim() || $("div.j2ttFe").text().trim() || "");
rating = rating.replace(/star/i, "").replace(",", ".").trim() || null;
const reviews = $("div.EHZ5gh").text().trim() || $("div.g1rdde:contains(\"ulasan\")").text().trim() || null;
const installs = cleanInstalls($("div.ClM7O").text().trim());
const description = $("div[data-g-id=\"description\"]").text().trim() || $(".bARER").text().trim() || null;
let icon = $("img[alt*=\"icon\" i]").attr("src") || $("img[alt=\"Ikon gambar\"]").attr("src") || null;
if (icon && icon.startsWith("//")) icon = "https:" + icon;
return { title, developer, rating, reviews, installs, description, icon };
}
// Pure regex fallback
const titleMatch = html.match(/<h1[^>]*>[\s\S]*?<span[^>]*itemprop="name"[^>]*>([^<]+)<\/span>/i) || html.match(/<h1[^>]*>([^<]+)<\/h1>/i);
const title = titleMatch ? titleMatch[1].trim() : null;
const devMatch = html.match(/\/store\/apps\/developer\?id=[^"]*"[^>]*>([^<]+)<\/a>/i) || html.match(/\/store\/apps\/dev\?id=[^"]*"[^>]*>([^<]+)<\/a>/i);
const developer = devMatch ? devMatch[1].trim() : null;
const ratingMatch = html.match(/itemprop="starRating"[^>]*>.*?([0-9.,]+)\s*star/is) || html.match(/class="j2ttFe"[^>]*>([0-9.,]+)/i);
const rating = ratingMatch ? ratingMatch[1].replace(",", ".").trim() : null;
const iconMatch = html.match(/src="(https:\/\/play-lh\.googleusercontent\.com\/[^"]+)"/i);
const icon = iconMatch ? iconMatch[1] : null;
return { title, developer, rating, reviews: null, installs: null, description: null, icon };
} catch {
return null;
}
}
/**
* APK Downloader and App Metadata Scraper
* @param {string} input - Google Play Store URL, package name, or search query
* @returns {Promise<object>}
*/
async function apkDownloader(input) {
if (!input || typeof input !== "string" || !input.trim()) {
throw new Error("Parameter input (Google Play URL / Package Name / Keyword) wajib disertakan.");
}
const cleanInput = input.trim();
let packageId = "";
// 1. Google Play Store URL
if (cleanInput.includes("play.google.com/store/apps/details")) {
const match = cleanInput.match(/[?&]id=([a-zA-Z0-9_.]+)/);
if (match) packageId = match[1];
} else if (/^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)+$/.test(cleanInput)) {
// 2. Direct Package ID (e.g. my.com.tngdigital.ewallet)
packageId = cleanInput;
} else {
// 3. Search query
const searchUrl = `https://ws75.aptoide.com/api/7/apps/search/query=${encodeURIComponent(cleanInput)}/limit=1`;
const searchRes = await fetch(searchUrl);
const searchData = await searchRes.json();
if (searchData.datalist?.list && searchData.datalist.list.length > 0) {
packageId = searchData.datalist.list[0].package;
} else {
throw new Error(`Aplikasi dengan kata kunci "${cleanInput}" tidak ditemukan.`);
}
}
if (!packageId) {
throw new Error("Gagal mengidentifikasi Package ID dari parameter yang diberikan.");
}
// Fetch APK binary details from CDN repository
const cdnUrl = `https://ws75.aptoide.com/api/7/app/get/package_name=${encodeURIComponent(packageId)}`;
const cdnRes = await fetch(cdnUrl);
const cdnData = await cdnRes.json();
const meta = cdnData?.nodes?.meta?.data;
if (!meta || !meta.file?.path) {
throw new Error(`Berkas APK untuk package "${packageId}" tidak tersedia untuk diunduh.`);
}
// Scrape Play Store metadata concurrently
const playMeta = await scrapePlayStore(packageId);
// Versions history
const versionsList = (cdnData.nodes?.versions?.list || []).slice(0, 5).map(v => ({
version: v.file?.vername || null,
versionCode: v.file?.vercode || null,
size: formatBytes(v.file?.filesize || v.size),
sizeBytes: v.file?.filesize || v.size,
md5: v.file?.md5sum || null,
updatedAt: v.updated || v.modified || null
}));
return {
status: true,
creator: "Vamz Spectre",
data: {
name: playMeta?.title || meta.name,
package: meta.package,
version: meta.file?.vername || null,
versionCode: meta.file?.vercode || null,
size: formatBytes(meta.file?.filesize || meta.size),
sizeBytes: meta.file?.filesize || meta.size,
updatedAt: meta.modified || meta.updated || null,
developer: {
name: playMeta?.developer || meta.developer?.name || null,
website: meta.developer?.website || null,
email: meta.developer?.email || null
},
stats: {
rating: playMeta?.rating || (meta.stats?.rating?.avg ? meta.stats.rating.avg.toFixed(1) : null),
reviews: playMeta?.reviews || null,
installs: playMeta?.installs || (meta.stats?.downloads ? `${meta.stats.downloads.toLocaleString()}+` : null)
},
icon: playMeta?.icon || meta.icon || null,
graphic: meta.graphic || null,
download: {
url: meta.file?.path,
altUrl: meta.file?.path_alt || null,
md5: meta.file?.md5sum || null,
minSdk: meta.file?.hardware?.sdk || null,
supportedCpu: meta.file?.hardware?.cpus || [],
securityStatus: meta.file?.malware?.rank || "UNKNOWN",
sha1: meta.file?.signature?.sha1 || null
},
description: playMeta?.description || null,
screenshots: meta.media?.screenshots?.map(s => s.url) || [],
versions: versionsList
}
};
}
// Module Export
module.exports = {
apkDownloader,
scrapePlayStore
};
// 1:1 CLI Runner
if (require.main === module) {
const target = process.argv[2] || "https://play.google.com/store/apps/details?id=my.com.tngdigital.ewallet";
apkDownloader(target)
.then(res => console.log(JSON.stringify(res, null, 2)))
.catch(err => {
console.error(JSON.stringify({ status: false, error: err.message }, null, 2));
process.exit(1);
});
}