import fetch from "node-fetch";

const handler = async (m, { conn, text, usedPrefix, command }) => { if (!text) throw Masukkan URL!\n\nContoh: ${usedPrefix}${command} https://open.spotify.com/track/0ZEYRVISCaqz5yamWZWzaA;

const dann = await fetch(https://api.nomisec07.site/api/spotify?url=${text}); const res = await dann.json();

const hasil = `• Judul: ${res.data.title} • Artis: ${res.data.artist.name} • Durasi: ${res.data.duration} • Terpopular: ${res.data.artist.uri} • ID: ${res.data.artist.id}

Audio sedang dikirim...`;

const title = res.data.title; const thumbnail = res.data.thumbnail; const preview = res.data.preview; const link = res.data.url;

const doc = { audio: { url: link }, mimetype: 'audio/mp4', fileName: ${title}, contextInfo: { externalAdReply: { showAdAttribution: true, mediaType: 2, mediaUrl: preview, title: title, body: wm, sourceUrl: preview, thumbnail: await (await conn.getFile(thumbnail)).data } } }

await conn.sendMessage(m.chat, { text: hasil, contextInfo: { externalAdReply: { title: title, body: wm, thumbnailUrl: thumbnail, sourceUrl: preview, mediaType: 1, renderLargerThumbnail: true } } }); await conn.sendMessage(m.chat, doc, m); }

handler.command = handler.help = ['spotify']; handler.tags = ['downloader'];

export default handler;

rubahlah javascript berikut ini menjadi code esmvar fetch = requirenode-fetch;var handler = async m conn text usedPrefix command = if !text throw Masukkan URL!nnContoh $usedPrefix command httpsop

原文地址: https://www.cveoy.top/t/topic/i6vA 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录