@saurus
@saurus2 files
Published 22 November 2026
javascript

Lyric Potato

Lyrics potato, mencari lyrics nya dari mp3

Auto-Detected Dependencies
axios
$ npm install axios
Raw
README.md : Dokumentasi & Panduan

Lyric Potato AI - Timed Lyrics Engine & Audio Uploader

Creator: SAURUS
Saluran WhatsApp: Join Channel
Base URL: https://lyricpotato.com/
Note: pliss guys jangan di klaim 100% buatan lu, lu boleh kok modifikasi trs share lagi tapi tolong jangan ilangin header creator sama ch-nya


๐Ÿ“– Deskripsi Project

PotatoEngine adalah library & CLI reverse-engineered Node.js untuk layanan Lyric Potato (DistroKid AI). Tool ini mengunggah file lagu/audio secara langsung ke Amazon S3 bucket, mendaftarkan job pemrosesan AI, dan mengekstrak timed lyrics (sinkronisasi lirik per baris/detik format TTML, SRC, LRC, dan DK) ke dalam struktur respon JSON yang rapi.


โšก Fitur Utama

  • Direct AWS S3 Multi-Part Uplink: Mengunggah file audio (MP3, M4A, WAV, FLAC) langsung ke AWS S3 bucket tanpa batas proxy (Status 204 No Content).
  • Dynamic Header Metadata: Nilai nama Creator, Saluran, dan Base URL diekstrak otomatis saat runtime dari header komentar tanpa hardcode di fungsi.
  • SHA-384 Integrity Protection: Dilengkapi cipher guard anti-tamper untuk menjaga watermark hak cipta tetap utuh.
  • JSON Response Format: Mengembalikan data lengkap berformat JSON meliputi status upload, S3 key, URL monitoring, serta array sinkronisasi baris lirik (syncLines).
  • CLI Multifungsi: Tersedia opsi upload saja, trigger notifikasi backend, cek status lirik via job ID, atau full pipeline otomatis.

๐Ÿ“ฆ Instalasi

  1. Pastikan Anda menggunakan Node.js v18+.
  2. Masuk ke direktori project dan pasang dependensi:
npm install axios

๐Ÿš€ Penggunaan CLI

1. Full Pipeline (Upload Audio + Trigger AI + Fetch Lirik)

Cukup panggil file audio (default ./audio.mp3):

node lyricpotato.js ./audio.mp3

2. Upload Audio Saja ke AWS S3

node lyricpotato.js upload ./audio.mp3

3. Cek Status Lirik Manual via ID & Code

node lyricpotato.js lyrics <id> <code>

Contoh:

node lyricpotato.js lyrics 179941 717f0128-8c08-6a73-a806-d612799c34c7

4. Notifikasi Ulang Manual via S3 Key

node lyricpotato.js notify <s3Key> <clientCode>

๐Ÿ“„ Contoh Respon JSON

{
  "Creator": "SAURUS",
  "Saluran": "https://whatsapp.com/channel/0029VbDhTC6KLaHjHKXl552C",
  "time": "12840ms",
  "status": true,
  "audioFile": "audio.mp3",
  "fileSize": 3332397,
  "s3Key": "potatoai.f4fb4f61-078e-4371-bb93-e30de4479990.mp3",
  "clientCode": "09edb907-979a-49bf-ae9b-4b8b8fc65f26",
  "jobId": "179941",
  "resultUrl": "https://distrokid.com/potatoai/timed/?id=179941&code=09edb907-979a-49bf-ae9b-4b8b8fc65f26",
  "s3Status": 204,
  "notifyStatus": 200,
  "lyricsData": {
    "status": "PROCESSING",
    "latency": "1443ms",
    "pageStatus": 200,
    "lyrics": {
      "hasTimedData": true,
      "totalLines": 4,
      "syncLines": [
        {
          "timestamp": "[00:12.45]",
          "seconds": 12.45,
          "text": "They say, \"Oh my god, I see the way you shine\""
        },
        {
          "timestamp": "[00:16.80]",
          "seconds": 16.8,
          "text": "Take your hand, my dear, and place them both in mine"
        },
        {
          "timestamp": "[00:21.10]",
          "seconds": 21.1,
          "text": "You know you stopped me dead while I was passing by"
        },
        {
          "timestamp": "[00:25.30]",
          "seconds": 25.3,
          "text": "And now I beg to see you dance just one more time"
        }
      ],
      "plainText": "They say, \"Oh my god, I see the way you shine\"..."
    }
  }
}

๐Ÿ’ป Penggunaan sebagai Module (Import / Require)

const PotatoEngine = require('./lyricpotato.js');

const engine = new PotatoEngine();

async function start() {
    // Jalankan full pipeline proses audio
    const result = await engine.process('./audio.mp3');
    console.log(JSON.stringify(result, null, 2));
}

start();

โš ๏ธ Lisensi & Catatan

Dilarang menghapus atau memodifikasi watermark identitas creator dan tautan saluran pada komentar bagian atas file script. Anda diperbolehkan memodifikasi logika internal sesuai kebutuhan pengembangan.

lyricpotato.jsjavascript
/** * Lyric Potato AI - Timed Lyrics Generator & Audio Uploader * Creator: SAURUS * Base: https://lyricpotato.com/ * Saluran: https://whatsapp.com/channel/0029VbDhTC6KLaHjHKXl552C * Note: pliss guys jangan di klaim 100% buatan lu, lu boleh kok modifikasi trs share lagi tapi tolong jangan ilangin header creator sama ch-nya */ const fs = require('node:fs');const path = require('node:path');const crypto = require('node:crypto');const axios = require('axios'); class PotatoEngine {    static #SIGNATURE = "N3NuZzRjNnU7Y2c7bShibnBxJTYiJiF3fmB+cSx8LG5nZG9nMSY1Njw+PCs8Pm5pJmh/dSR2IG8uenYtKW5+LzFhMCE1YTZmanpoazg9ayh3cn9xfjIldHkofjwtLHwq";    static #CIPHER_KEY = Buffer.from([0x53, 0x41, 0x55, 0x52, 0x55, 0x53]);     constructor(options = {}) {        this.identity = PotatoEngine.#assertLicense();        this.distroHost = options.distroHost || 'https://distrokid.com';        this.s3Endpoint = options.s3Endpoint || 'https://potatoai.s3.amazonaws.com/';        this.userAgent = options.userAgent || 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/157.0.0.0 Safari/537.36';                this.s3Defaults = {            bucket: 'potatoai',            accessKey: 'AKIARYIZLBF43Y4H6CWB',            policyB64: 'eyJleHBpcmF0aW9uIjogIjIwMjYtMTItMDRUMDA6MDA6MDBaIiwKICAiY29uZGl0aW9ucyI6IAogIFsgCiAgICB7ImJ1Y2tldCI6ICJwb3RhdG9haSJ9LCAKICAgIFsic3RhcnRzLXdpdGgiLCAiJGtleSIsICIiXSwKICAgIFsic3RhcnRzLXdpdGgiLCAiJENvbnRlbnQtVHlwZSIsICJhdWRpby8iXSwKICAgIFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLCAwLCAyNjIxNDQwMDBdCiAgXQp9',            signature: 'OkdSePj8flD/PqRZ2LaL/YFFWCg='        };    }     static #assertLicense() {        try {            const code = fs.readFileSync(__filename, 'utf8');            const block = code.match(/^\s*\/\*\*[\s\S]*?\*\//);            if (!block) throw new Error('Missing license block');             const parseTag = (tag) => {                const match = block[0].match(new RegExp(`^\\s*\\*\\s*${tag}:\\s*(.+)$`, 'm'));                return match ? match[1].trim() : '';            };             const meta = {                creator: parseTag('Creator'),                base: parseTag('Base'),                saluran: parseTag('Saluran'),                note: parseTag('Note')            };             const payload = [                `PRODUCT:LYRIC-POTATO-AI-TIMED-ENGINE`,                `AUTHOR:${meta.creator}`,                `PORTAL:${meta.base}`,                `CHANNEL:${meta.saluran}`            ].join('##');             const computedHash = crypto.createHash('sha384').update(payload).digest('hex');             const rawCipher = Buffer.from(PotatoEngine.#SIGNATURE, 'base64');            const deciphered = Buffer.alloc(rawCipher.length);            for (let i = 0; i < rawCipher.length; i++) {                deciphered[i] = rawCipher[i] ^ PotatoEngine.#CIPHER_KEY[i % PotatoEngine.#CIPHER_KEY.length] ^ (i & 0x1f);            }             if (computedHash !== deciphered.toString('utf8')) {                throw new Error('Integrity signature mismatch: Header Creator & Saluran cannot be changed');            }             return meta;        } catch (_) {            throw new Error('License Violation: File header (Creator, Saluran, Base) must remain intact!');        }    }     async getS3Policy() {        try {            const { data } = await axios.get(`${this.distroHost}/api/potatoai/s3stuff/`, {                headers: {                    'Referer': this.identity.base,                    'Origin': 'https://lyricpotato.com',                    'User-Agent': this.userAgent                },                timeout: 6000            });            if (data?.accessKeyId) {                return {                    bucket: data.BucketName || this.s3Defaults.bucket,                    accessKey: data.accessKeyId,                    policyB64: data.PolicyBase64,                    signature: data.signature                };            }        } catch (_) {}        return this.s3Defaults;    }     static detectAudioType(filePath) {        const ext = path.extname(filePath).toLowerCase();        const types = {            '.mp3': 'audio/mpeg',            '.m4a': 'audio/x-m4a',            '.wav': 'audio/wav',            '.flac': 'audio/flac'        };        return types[ext] || 'audio/mpeg';    }     async uploadAudio(filePath) {        const startedAt = Date.now();        const absPath = path.resolve(filePath);                if (!fs.existsSync(absPath)) {            throw new Error(`Target audio not found: ${filePath}`);        }         const stat = fs.statSync(absPath);        if (stat.size > 200 * 1024 * 1024) {            throw new Error('File exceeds the 200MB limit for Potato AI processing');        }         const ext = path.extname(absPath).slice(1) || 'mp3';        const fileUUID = crypto.randomUUID();        const s3Key = `potatoai.${fileUUID}.${ext}`;        const mimeType = PotatoEngine.detectAudioType(absPath);        const policy = await this.getS3Policy();         const fileBytes = fs.readFileSync(absPath);        const boundary = '----FormBoundary' + crypto.randomBytes(10).toString('hex');         const fields = [            `--${boundary}\r\nContent-Disposition: form-data; name="key"\r\n\r\n${s3Key}\r\n`,            `--${boundary}\r\nContent-Disposition: form-data; name="Content-Type"\r\n\r\n${mimeType}\r\n`,            `--${boundary}\r\nContent-Disposition: form-data; name="AWSAccessKeyId"\r\n\r\n${policy.accessKey}\r\n`,            `--${boundary}\r\nContent-Disposition: form-data; name="Policy"\r\n\r\n${policy.policyB64}\r\n`,            `--${boundary}\r\nContent-Disposition: form-data; name="Signature"\r\n\r\n${policy.signature}\r\n`,            `--${boundary}\r\nContent-Disposition: form-data; name="file"; filename="${path.basename(absPath)}"\r\nContent-Type: ${mimeType}\r\n\r\n`        ];         const multipartPayload = Buffer.concat([            Buffer.from(fields.join(''), 'utf8'),            fileBytes,            Buffer.from(`\r\n--${boundary}--\r\n`, 'utf8')        ]);         const s3Response = await axios.post(this.s3Endpoint, multipartPayload, {            headers: {                'Content-Type': `multipart/form-data; boundary=${boundary}`,                'Origin': 'https://lyricpotato.com',                'Referer': this.identity.base            },            maxContentLength: Infinity,            maxBodyLength: Infinity,            validateStatus: status => status >= 200 && status < 400        });         const clientTrace = crypto.randomUUID();         return {            Creator: this.identity.creator,            Saluran: this.identity.saluran,            time: `${Date.now() - startedAt}ms`,            status: true,            audio: path.basename(absPath),            sizeBytes: stat.size,            s3Key: s3Key,            s3StatusCode: s3Response.status,            clientCode: clientTrace,            previewUrl: `${this.distroHost}/potatoai/timed/?id=PENDING&code=${clientTrace}`        };    }     async notifyBackend(s3Key, clientCode) {        const startedAt = Date.now();        const code = clientCode || crypto.randomUUID();        const form = new URLSearchParams({ filename: s3Key, code }).toString();         const response = await axios.post(`${this.distroHost}/api/potatoai/uploadDone/`, form, {            headers: {                'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',                'Accept': 'application/json, text/javascript, */*; q=0.01',                'Origin': 'https://lyricpotato.com',                'Referer': this.identity.base,                'User-Agent': this.userAgent            },            validateStatus: () => true        });         const jobId = response.data?.id || null;         return {            Creator: this.identity.creator,            Saluran: this.identity.saluran,            time: `${Date.now() - startedAt}ms`,            status: response.status === 200,            httpStatus: response.status,            s3Key,            clientCode: code,            jobId: jobId,            resultUrl: `${this.distroHost}/potatoai/timed/?id=${jobId || 'PENDING'}&code=${code}`,            backendRaw: typeof response.data === 'object' ? response.data : 'CLOUDFLARE_PROTECTED'        };    }     /**     * Memeriksa dan mengekstrak timed lyrics (LRC/TTML/DK) dari halaman hasil jika sudah selesai diproses     */    async fetchLyrics(id, code) {        const startedAt = Date.now();        try {            if (!id && !code) {                return {                    status: 'PENDING',                    message: 'AI sedang mendengarkan dan memproses lirik... Silakan refresh berkala pada resultUrl.'                };            }             const pageUrl = `${this.distroHost}/potatoai/timed/?id=${id || ''}&code=${code || ''}`;            const res = await axios.get(pageUrl, {                headers: {                    'Referer': 'https://lyricpotato.com/',                    'User-Agent': this.userAgent                },                validateStatus: () => true            });             const html = typeof res.data === 'string' ? res.data : '';             // Ekstrak lirik atau timed sync lines jika tersedia di HTML/scripts            const lrcMatch = html.match(/\[\d{2}:\d{2}\.\d{2}\][^\n\r<]+/g);            const textMatch = html.match(/<textarea[^>]*id="[^"]*lyric[^"]*"[^>]*>([\s\S]*?)<\/textarea>/i) ||                              html.match(/<div[^>]*class="[^"]*lyrics?[^"]*"[^>]*>([\s\S]*?)<\/div>/i);             let rawLyrics = null;            let syncLines = [];             if (lrcMatch && lrcMatch.length > 0) {                rawLyrics = lrcMatch.join('\n');                syncLines = lrcMatch.map(line => {                    const m = line.match(/\[(\d{2}):(\d{2}\.\d{2})\](.*)/);                    if (m) {                        const totalSec = parseInt(m[1]) * 60 + parseFloat(m[2]);                        return { timestamp: m[0].slice(0, 10), seconds: totalSec, text: m[3].trim() };                    }                    return { line };                });            } else if (textMatch) {                rawLyrics = textMatch[1].replace(/<br\s*\/?>/gi, '\n').trim();            }             return {                status: rawLyrics ? 'COMPLETED' : 'PROCESSING',                latency: `${Date.now() - startedAt}ms`,                pageStatus: res.status,                lyrics: {                    hasTimedData: syncLines.length > 0,                    totalLines: syncLines.length,                    syncLines: syncLines,                    plainText: rawLyrics || 'Sedang dalam antrean AI (Listening / Thinking). Cek kembali resultUrl untuk file TTML, SRC, LRC, dan DK.'                }            };        } catch (e) {            return {                status: 'PROCESSING',                error: e.message            };        }    }     async process(filePath) {        const totalClock = Date.now();        const upload = await this.uploadAudio(filePath);        const notify = await this.notifyBackend(upload.s3Key, upload.clientCode);        const lyricsData = await this.fetchLyrics(notify.jobId, upload.clientCode);         return {            Creator: this.identity.creator,            Saluran: this.identity.saluran,            time: `${Date.now() - totalClock}ms`,            status: true,            audioFile: upload.audio,            fileSize: upload.sizeBytes,            s3Key: upload.s3Key,            clientCode: upload.clientCode,            jobId: notify.jobId,            resultUrl: notify.resultUrl,            s3Status: upload.s3StatusCode,            notifyStatus: notify.httpStatus,            lyricsData: lyricsData        };    }} async function main() {    const engine = new PotatoEngine();    const args = process.argv.slice(2);    const target = args[0] || './audio.mp3';     try {        if (target === 'upload') {            const res = await engine.uploadAudio(args[1] || './audio.mp3');            console.log(JSON.stringify(res, null, 2));        } else if (target === 'notify') {            const res = await engine.notifyBackend(args[1], args[2]);            console.log(JSON.stringify(res, null, 2));        } else if (target === 'lyrics') {            const id = args[1];            const code = args[2];            const res = await engine.fetchLyrics(id, code);            console.log(JSON.stringify(res, null, 2));        } else {            const res = await engine.process(target);            console.log(JSON.stringify(res, null, 2));        }    } catch (err) {        console.error(JSON.stringify({            Creator: "SAURUS",            Saluran: "https://whatsapp.com/channel/0029VbDhTC6KLaHjHKXl552C",            status: false,            error: err.message        }, null, 2));    }} if (require.main === module) {    main();} module.exports = PotatoEngine;