aijavascript328
AISong.io Scraper & Suno AI Music Generator
Scraper aisong.io & generator musik AI Suno (Chirp Hawk) gratis unli dengan auto-session temp-mail, auto-OTP bypass, feed community, showcase, dan direct stream extractor.
Vamz Spectre19 Nov 2026321 baris kode
Jalankan via Terminal / CLI:
# 1. Download file script
curl -sL "https://code.vamxapi.my.id/snippet/raw/aisong" -o aisong.js
# 2. Jalankan script
node aisong.js
Dependencies npm yang Dibutuhkan:
npm install None (Built-in Node.js v18+ fetch)Panduan Penggunaan:
### Cara Pakai via CLI:
1. Download snippet:
```bash
curl -sL "https://code.vamxapi.my.id/snippet/raw/aisong" -o aisong.js
```
2. Jalankan perintah:
```bash
# 1. Ambil lagu showcase Indonesia
node aisong.js "showcase"
# 2. Ambil feed musik komunitas
node aisong.js "community"
# 3. Ambil detail lagu & direct stream MP3
node aisong.js "6b7f25ba-2984-458c-83dc-7fd468811f78"
# 4. Generate lagu AI baru gratis (Auto-Session Bypass)
node aisong.js "generate" "Lagu pop akustik ceria tentang kopi manis" "Kopi Manis" "pop, acoustic"
```
### Sebagai Module Node.js:
```javascript
const { aisong, generateMusic, getCommunity, getShowcase, getDetail } = require("./aisong");
// Generate lagu AI baru
const song = await generateMusic("Lagu pop santai di pantai", "Santai Pantai", "reggae pop");
console.log(song);
```
aisong.js(321 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
/**
* AISong Scraper & AI Music Generator (aisong.io)
* Powered by Suno AI Engine (Chirp Hawk / Chirp v5/v6)
* Author: Vamz Spectre (VamxAPI)
*
* Download:
* curl -sL "https://code.vamxapi.my.id/snippet/raw/aisong" -o aisong.js
*
* Usage CLI:
* node aisong.js "showcase"
* node aisong.js "community"
* node aisong.js "6b7f25ba-2984-458c-83dc-7fd468811f78"
* node aisong.js "generate" "Lagu santai akustik kopi pagi" "Secangkir Kopi" "acoustic pop"
*/
const 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-Language": "id-ID,id;q=0.9,en-US;q=0.8,en;q=0.7"
};
/**
* 1. Ambil Showcase Music dari homepage aisong.io/id
*/
async function getShowcase(locale = "id") {
const url = `https://aisong.io/${locale}`;
const res = await fetch(url, { headers: HEADERS });
if (!res.ok) throw new Error(`HTTP Error: ${res.status}`);
const html = await res.text();
const match = html.match(/\\"showcase\\":\{[\s\S]*?\\"items\\":(\[[\s\S]*?\]),\\"grid\\"/);
if (!match) throw new Error("Gagal mengekstrak showcase data");
const rawJson = match[1].replace(/\\"/g, "\"").replace(/\\\\/g, "\\");
const items = JSON.parse(rawJson);
return {
status: true,
type: "showcase",
locale,
total: items.length,
data: items.map(item => ({
title: item.title,
description: item.description,
badge: item.label || null,
thumbnail: item.image_url ? (item.image_url.startsWith("http") ? item.image_url : `https://aisong.io${item.image_url}`) : null,
audio_url: item.music_url
}))
};
}
/**
* 2. Ambil Feed Musik Publik dari Komunitas aisong.io
*/
async function getCommunity() {
const url = "https://aisong.io/community";
const res = await fetch(url, {
headers: {
...HEADERS,
"RSC": "1"
}
});
if (!res.ok) throw new Error(`HTTP Error: ${res.status}`);
const text = await res.text();
const match = text.match(/"musics":(\[\{"id":[\s\S]*?\}\]),"totalPosts"/);
if (!match) throw new Error("Gagal mengekstrak community musics");
const musics = JSON.parse(match[1]);
return {
status: true,
type: "community",
total: musics.length,
data: musics.map(m => ({
id: m.music_id || m.id,
title: m.title,
prompt: m.prompt,
duration: m.duration,
tags: m.tags || [],
is_instrumental: Boolean(m.is_instrumental),
audio_url: m.audio_url,
image_url: m.image_url,
likes: m.likes_count,
plays: m.plays_count,
model: m.metadata?.suno_model || null,
created_at: m.created_at
}))
};
}
/**
* 3. Ambil Detail Lagu & Direct Audio Stream berdasarkan ID atau URL
*/
async function getDetail(idOrUrl) {
let id = idOrUrl.trim();
if (id.includes("/")) {
const parts = id.split("/").filter(Boolean);
id = parts[parts.length - 1];
}
const url = `https://aisong.io/music/${id}`;
const res = await fetch(url, {
headers: {
...HEADERS,
"RSC": "1"
}
});
if (!res.ok) throw new Error(`HTTP Error: ${res.status}`);
const text = await res.text();
const audioMatch = text.match(/audioUrl":"([^"]+)"/);
const artistMatch = text.match(/artist":"([^"]+)"/);
const coverMatch = text.match(/coverImage":"([^"]+)"/);
const durationMatch = text.match(/duration\\":\\"PT([^"\\]+)\\"/);
const titleMatch = text.match(/MusicRecording[\\",\s]+name[\\":\s]+([^\\",]+)/);
return {
status: true,
type: "detail",
id,
url,
title: titleMatch ? titleMatch[1] : null,
artist: artistMatch ? artistMatch[1] : null,
duration: durationMatch ? durationMatch[1] : null,
cover_image: coverMatch ? coverMatch[1] : null,
audio_url: audioMatch ? audioMatch[1] : `https://r2.aisong.io/audio/${id}.mp3`
};
}
/**
* 4. Generator Akun & Sesi Otomatis (Temp Mail + OTP Auto-Login)
*/
async function createAutoSession() {
// 1. Buat alamat email temporer via Guerrilla Mail
const gres = await fetch("https://api.guerrillamail.com/ajax.php?f=get_email_address");
const gdata = await gres.json();
const email = gdata.email_addr;
const sid_token = gdata.sid_token;
// 2. Minta kode OTP ke aisong.io
const sres = await fetch("https://aisong.io/api/auth/send-verification-code", {
method: "POST",
headers: { ...HEADERS, "Content-Type": "application/json" },
body: JSON.stringify({ email })
});
const sjson = await sres.json();
if (!sjson.ok) throw new Error("Gagal mengirim kode verifikasi ke email");
// 3. Polling inbox untuk mendapatkan kode 6 digit
let otpCode = null;
for (let i = 0; i < 15; i++) {
await new Promise(r => setTimeout(r, 2500));
const mres = await fetch(`https://api.guerrillamail.com/ajax.php?f=check_email&seq=1&sid_token=${sid_token}`);
const mdata = await mres.json();
if (mdata.list && mdata.list.length > 0) {
for (const mail of mdata.list) {
const match = (mail.mail_subject || "").match(/\b(\d{6})\b/);
if (match) {
otpCode = match[1];
break;
}
}
}
if (otpCode) break;
}
if (!otpCode) throw new Error("Timeout: Gagal menerima kode verifikasi email");
// 4. Ambil CSRF token NextAuth
const csrfRes = await fetch("https://aisong.io/api/auth/csrf");
const { csrfToken } = await csrfRes.json();
const csrfCookies = csrfRes.headers.getSetCookie ? csrfRes.headers.getSetCookie() : [csrfRes.headers.get("set-cookie")];
const csrfCookieHeader = csrfCookies.map(c => c.split(";")[0]).join("; ");
// 5. Sign in untuk mendapatkan session token
const signinRes = await fetch("https://aisong.io/api/auth/callback/verification-code", {
method: "POST",
headers: {
...HEADERS,
"Content-Type": "application/x-www-form-urlencoded",
"Cookie": csrfCookieHeader
},
body: new URLSearchParams({
email,
code: otpCode,
csrfToken,
callbackUrl: "https://aisong.io",
json: "true"
}),
redirect: "manual"
});
const sessionCookies = signinRes.headers.getSetCookie ? signinRes.headers.getSetCookie() : [signinRes.headers.get("set-cookie")];
const sessionToken = sessionCookies.map(c => c.split(";")[0]).find(c => c.includes("session-token"));
if (!sessionToken) throw new Error("Gagal memperoleh session token NextAuth");
return sessionToken;
}
/**
* 5. Generate Lagu AI Baru (Full Auto-Session + Polling Sampai Jadi)
*/
async function generateMusic(prompt, title = "AI Song", tags = "pop, acoustic", isInstrumental = false) {
if (!prompt) throw new Error("Parameter prompt wajib diisi");
// Buat sesi login otomatis
const sessionCookie = await createAutoSession();
// Kirim task pembuatan lagu ke Suno AI engine
const genRes = await fetch("https://aisong.io/api/v2/generate", {
method: "POST",
headers: {
...HEADERS,
"Content-Type": "application/json",
"Cookie": sessionCookie
},
body: JSON.stringify({
inputType: "10",
prompt,
title,
tags,
makeInstrumental: Boolean(isInstrumental),
mvVersion: "chirp-v6.0"
})
});
const genData = await genRes.json();
if (genData.code !== 200 || !genData.data?.taskBatchId) {
throw new Error(genData.msg || "Gagal membuat task generate musik");
}
const batchId = genData.data.taskBatchId;
// Polling status task hingga selesai
let resultItems = [];
for (let i = 0; i < 30; i++) {
await new Promise(r => setTimeout(r, 4000));
const stateRes = await fetch(`https://aisong.io/api/v2/task-state?taskBatchId=${batchId}`, {
headers: {
...HEADERS,
"Cookie": sessionCookie
}
});
const stateJson = await stateRes.json();
if (stateJson.code === 200 && stateJson.data?.taskStatus === "finished") {
resultItems = stateJson.data.items || [];
break;
}
}
if (resultItems.length === 0) {
throw new Error("Timeout: Musik masih dalam antrean proses pembuatan");
}
return {
status: true,
type: "generate",
task_batch_id: batchId,
total_tracks: resultItems.length,
tracks: resultItems.map(item => ({
id: item.id,
title: item.title,
model: item.sunoModel || item.modelName,
duration: item.duration,
tags: item.tags,
prompt: item.prompt,
image_url: item.imageUrl,
audio_stream_url: item.audioUrl?.startsWith("/api") ? `https://aisong.io${item.audioUrl}` : item.audioUrl,
direct_m4a_url: item.audioUrl?.includes("url=") ? decodeURIComponent(item.audioUrl.split("url=")[1].split("&")[0]) : item.audioUrl
}))
};
}
/**
* Main Controller
*/
async function aisong(action = "showcase", arg1 = "", arg2 = "", arg3 = "") {
const act = String(action).toLowerCase().trim();
if (act === "generate" || act === "create") {
return await generateMusic(arg1, arg2, arg3);
}
if (act === "community" || act === "feed") {
return await getCommunity();
}
if (act === "showcase" || act === "id" || !act) {
return await getShowcase("id");
}
return await getDetail(action);
}
// Module Exports
module.exports = {
aisong,
getShowcase,
getCommunity,
getDetail,
generateMusic
};
// CLI Runner
if (require.main === module) {
(async () => {
try {
const args = process.argv.slice(2);
const action = args[0] || "showcase";
const arg1 = args[1] || "";
const arg2 = args[2] || "";
const arg3 = args[3] || "";
const result = await aisong(action, arg1, arg2, arg3);
console.log(JSON.stringify(result, null, 2));
} catch (err) {
console.error(JSON.stringify({
status: false,
error: err.message
}, null, 2));
process.exit(1);
}
})();
}