Spaces:
Paused
Paused
Update index.js
Browse files461 unmodified lines46246346446546546646746876 unmodified lines545546547548548461 unmodified linesasync function addAudioTags(media, title, artist, year, imagecover) { try { let audioBuffer = (typeof media === 'string') ? Buffer.from((await axios.get(media, { responseType: 'arraybuffer', maxContentLength: -1 })).data) : (media instanceof Buffer) ? media : (() => { throw new Error('Media harus berupa URL string atau Buffer.'); })(); const randomFilename = title.replace(/[^\w\s\#\$\&\-\+\(\)\/\[\]\`\×\{\}\\\\\~\•]/g, '') + '.mp3'; const randomFilename = generateRandomName(10) + '.mp3'; const tmpFilePath = path.join(tempDir, randomFilename); fs.writeFileSync(tmpFilePath, audioBuffer); const tags = { title, artist, year };76 unmodified lines
app.listen(PORT, () => { console.log(`Server is running on port https://localhost:${PORT}`);});});index.js+2-2