Skip to content

Instantly share code, notes, and snippets.

@manzxy
Created December 25, 2025 21:18
Show Gist options
  • Select an option

  • Save manzxy/2f2185026f9d645d0f9a0fcc18b9a4ea to your computer and use it in GitHub Desktop.

Select an option

Save manzxy/2f2185026f9d645d0f9a0fcc18b9a4ea to your computer and use it in GitHub Desktop.
Uploaded via YogiriMD
import axios from "axios"
let handler = async (m, { conn, args, command }) => {
try {
if (!args[0])
return m.reply(`📌 Contoh:\n.${command} https://youtube.com/watch?v=xxxx`)
await m.reply("⏳ Mengambil audio...")
const api = `https://manzxy-0ffec284845b.herokuapp.com/api/downloader/ytmp3?url=${encodeURIComponent(args[0])}`
const { data } = await axios.get(api)
if (!data.success) throw "Gagal mengambil audio"
const {
title,
image,
download_url
} = data
// === KIRIM AUDIO DENGAN THUMBNAIL & JUDUL ===
await conn.sendMessage(
m.chat,
{
audio: { url: download_url },
mimetype: "audio/mpeg",
fileName: `${title}.mp3`,
contextInfo: {
externalAdReply: {
title: title,
body: "YouTube MP3",
thumbnailUrl: image,
mediaType: 1,
renderLargerThumbnail: true
}
}
},
{ quoted: m }
)
} catch (e) {
console.error(e)
m.reply("❌ Gagal memproses YouTube MP3")
}
}
handler.help = ["ytmp3 <url>"]
handler.tags = ["downloader"]
handler.command = ["ytmp3", "ytaudio"]
export default handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment