import yts from 'yt-search'; let handler = async (m, { conn, usedPrefix, text, args, command }) => { if (!text) return m.reply(`*ΒΏQuΓ© estΓ‘ buscando?* Ingrese el nombre del tema\n*β€’ Ejemplo*\n*${usedPrefix + command}* bad bunny`); m.react('πŸ“€'); let result = await yts(text); let ytres = result.videos; if (!ytres.length) return m.reply('❌ No se encontraron resultados.'); if (m.isWABusiness) { let textoo = `*β€’ Resultados de:* ${text}\n\n`; for (let i = 0; i < Math.min(15, ytres.length); i++) { let v = ytres[i]; textoo += `🎡 *TΓ­tulo:* ${v.title}\nπŸ“† *Publicado hace:* ${v.ago}\nπŸ‘€ *Vistas:* ${v.views}\nβŒ› *DuraciΓ³n:* ${v.timestamp}\nπŸ”— *Enlace:* ${v.url}\n\n⊱ ────── {.β‹… β™« β‹….} ───── ⊰\n\n`; } await conn.sendFile(m.chat, ytres[0].image, 'thumbnail.jpg', textoo, m, null, fake); } else { let selectedResults = ytres.slice(0, 9); let messages = selectedResults.map(v => [ ``, `🎡 *TΓ­tulo:* ${v.title}\nπŸ“† Publicado hace: ${v.ago}\nπŸ‘€ Vistas: ${v.views}\nβŒ› DuraciΓ³n: ${v.timestamp}`, v.image, [], [["Copia para descargar", `.ytmp4 ${v.url}`]], [], []]); await conn.sendCarousel(m.chat, `βœ… Resultados para: ${text}`, "🎡 YouTube Search", messages, m); } }; handler.help = ['playlist', 'yts']; handler.tags = ['downloader']; handler.command = ['playvid2', 'playlist', 'playlista', 'yts', 'ytsearch']; handler.register = true; export default handler; /*Codigo con la listas obsoleto import yts from 'yt-search'; let handler = async (m, { conn, usedPrefix, text, args, command }) => { if (!text) return m.reply(`*Que esta buscado?* ingrese el nombre del tema\n*β€’ Ejemplo*\n*${usedPrefix + command}* bad bunny `) m.react('πŸ“€'); let result = await yts(text); let ytres = result.videos; let listSections = []; for (let index in ytres) { let v = ytres[index]; listSections.push({title: `${index} | ${v.title}`, rows: [{header: 'β€’ β€’ β€’γ€Œ πŸ…πŸ…€πŸ…“πŸ…˜πŸ…ž 」‒ β€’ β€’', title: "", description: `β–’ ⌚ DuraciΓ³n:* ${v.timestamp}\nβ–’ πŸ‘€ *Vistas:* ${v.views}\nβ–’ πŸ“Œ *Publicado* : ${v.title}\nβ–’ πŸ“† *Subidos:* ${v.ago}\n`, id: `${usedPrefix}fgmp3 ${v.url}` }, { header: "β€’ β€’ β€’γ€Œ πŸ…₯πŸ…˜πŸ…“πŸ…”πŸ…ž 」‒ β€’ β€’", title: "" , description: `β–’ ⌚ DuraciΓ³n:* ${v.timestamp}\nβ–’ πŸ‘€ *Vistas:* ${v.views}\nβ–’ πŸ“Œ *Publicado* : ${v.title}\nβ–’ πŸ“† *Subidos:* ${v.ago}\n`, id: `${usedPrefix}fgmp4 ${v.url}` }, { header: "β€’ β€’ β€’γ€Œ πŸ…“πŸ…žπŸ…’πŸ…€πŸ…œπŸ…”πŸ…πŸ…£πŸ…žπŸ…’ πŸ…œπŸ…ŸβΈ 」‒ β€’ β€’", title: "" , description: `β–’ ⌚ DuraciΓ³n:* ${v.timestamp}\nβ–’ πŸ‘€ *Vistas:* ${v.views}\nβ–’ πŸ“Œ *Publicado* : ${v.title}\nβ–’ πŸ“† *Subidos:* ${v.ago}\n`, id: `${usedPrefix}ytmp3doc ${v.url}` }, { header: "'β€’ β€’ β€’γ€Œ πŸ…“πŸ…žπŸ…’πŸ…€πŸ…œπŸ…”πŸ…πŸ…£πŸ…žπŸ…’ πŸ…œπŸ…ŸβΉ 」‒ β€’ β€’", title: "" , description: `β–’ ⌚ DuraciΓ³n:* ${v.timestamp}\nβ–’ πŸ‘€ *Vistas:* ${v.views}\nβ–’ πŸ“Œ *Publicado* : ${v.title}\nβ–’ πŸ“† *Subidos:* ${v.ago}\n`, id: `${usedPrefix}ytmp4doc ${v.url}` }]});} await conn.sendList(m.chat, `*β€’ Resultados:* ${text}*\n\n> *α΄‡ΚŸΙͺα΄Šα΄€ α΄€ α΄œΙ΄α΄€ α΄α΄˜α΄„Ιͺᴏɴ ʏ α΄˜Κ€α΄‡sΙͺᴏɴᴇ ᴇɴᴠΙͺα΄€Κ€*`, wm, `πŸš€ π™π™€π™Žπ™π™‡π™π˜Όπ˜Ώπ™Šπ™Ž πŸš€`, ytres[0].image, listSections, m); }; handler.help = ['playlist', 'yts'] handler.tags = ['downloader'] handler.command = ['playvid2', 'playlist', 'playlista', 'yts', 'ytsearch'] handler.register = true export default handler */