Skip to content

Instantly share code, notes, and snippets.

@ayashiiiyo
Created May 16, 2026 07:49
Show Gist options
  • Select an option

  • Save ayashiiiyo/26ffca475762ff122670441a16fe6ebb to your computer and use it in GitHub Desktop.

Select an option

Save ayashiiiyo/26ffca475762ff122670441a16fe6ebb to your computer and use it in GitHub Desktop.
let handler = async (m, { conn, args, command }) => {
try {
if (!args[0]) return m.reply(`*Example :* .${command} https://open.spotify.com/track/7jvwORp293fGCP6KfmE8aQ`)
m.reply(global.wait)
let { data } = await (await fetch(`https://fgsi.dpdns.org/api/downloader/spotify?apikey=APIKEY_KAMU&url=${encodeURIComponent(args[0])}`)).json()
await conn.sendMessage(m.chat, {
image: {
url: data.image
},
caption: `
*${data.title}*
*Type :* ${data.type}
*Artist :* ${data.artis}
*Duration :* ${Math.floor(data.durasi / 60000)}:${String(Math.floor(data.durasi % 60000 / 1000)).padStart(2, '0')}
> Send Audio
`.trim()
}, { quoted: m })
await conn.sendMessage(m.chat, {
audio: {
url: data.download
},
mimetype: 'audio/mpeg',
}, { quoted: m })
} catch (e) {
m.reply(e.message)
}
}
handler.help = ['spotify', 'spdl']
handler.command = ['spotify', 'spdl']
handler.tags = ['downloader']
export default handler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment