# aplmate.js Wrapper Node.js (ESM) untuk [aplmate.com](https://aplmate.com). Input link Apple Music, output JSON berisi metadata + URL direct download. - Tanpa dependency, Node.js 18+ ## CLI ```bash node aplmate.js https://music.apple.com/id/song/nicole-kidman/6792884088 ``` | Opsi | Keterangan | |---|---| | `-r, --resolve ` | Album/playlist: jumlah track yang diambil link downloadnya (default `1`) | | `-t, --turnstile ` | Token `cf-turnstile-response`, hanya jika situs memintanya | | `-c, --cookie ` / `--ua ` | Cookie `cf_clearance` + User-Agent browser, jika kena 403 | | `-o, --out ` | Simpan JSON ke file | ## Module ```js import aplmate from "./aplmate.js"; const data = await aplmate("https://music.apple.com/gb/song/6769553656"); console.log(JSON.stringify(data, null, 2)); ``` ## Output ```json { "status": true, "input": "https://music.apple.com/gb/song/6769553656", "total": 1, "resolved": 1, "results": [ { "index": 1, "id": "6769553656", "title": "Great Expectation", "artist": "SIENNA SPIRO", "album": "Visitor", "duration": "2:53", "cover": "https://is1-ssl.mzstatic.com/image/thumb/.../630x630bb.jpg", "url": "https://music.apple.com/gb/song/6769553656", "download": { "mp3": "https://cdndl.aplmate.com/mp3?token=...", "cover_hd": "https://cdndl.aplmate.com/mp3?token=...", "filename": "Great Expectation - SIENNA SPIRO.mp3", "expires_at": "2026-10-17T14:58:27.000Z" } } ] } ``` Error: `{ "status": false, "error": "...", "code": "..." }` (exit code 1). ## Catatan - Link download kedaluwarsa ±1 jam. - Situs memakai Cloudflare Turnstile. Jika muncul `TURNSTILE_REQUIRED`, ambil `cf-turnstile-response` dari DevTools (Network → request `action` → Payload) dan kirim lewat `--turnstile`. - Ini scraper situs pihak ketiga, jadi bisa rusak jika situs berubah. Gunakan sesuai ketentuan layanan dan hukum hak cipta setempat.