Created
December 25, 2025 21:18
-
-
Save manzxy/2f2185026f9d645d0f9a0fcc18b9a4ea to your computer and use it in GitHub Desktop.
Uploaded via YogiriMD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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