Skip to content

Commit

Permalink
Update yts.js
Browse files Browse the repository at this point in the history
  • Loading branch information
cobrs11 authored Aug 18, 2024
1 parent ee570e2 commit 5f116ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/plugin/yts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import yts from 'yt-search';
import ytdl from 'ytdl-core';
import fg from 'api-dylux';
import pkg, { prepareWAMessageMedia } from '@whiskeysockets/baileys';
const { generateWAMessageFromContent, proto } = pkg;

Expand Down Expand Up @@ -76,10 +76,10 @@ const song = async (m, Matrix) => {
},
interactiveMessage: proto.Message.InteractiveMessage.create({
body: proto.Message.InteractiveMessage.Body.create({
text: `IMALKAHANSAMAL-𝞛𝘿 Video Downloader\n\n`
text: `📍HANSAMAL-MD Video Downloader\n\n`
}),
footer: proto.Message.InteractiveMessage.Footer.create({
text: "© Powered By Ethix-MD"
text: "© Powered By HANSAMAL-MD"
}),
header: proto.Message.InteractiveMessage.Header.create({
...(await prepareWAMessageMedia({ image: { url: `"https://telegra.ph/file/005ceb36ec2a141f6c891.jpg` } }, { upload: Matrix.waUploadToServer })),
Expand Down Expand Up @@ -161,15 +161,15 @@ const song = async (m, Matrix) => {
const audioStream = ytdl(videoUrl, { filter: 'audioonly', quality: 'highestaudio' });
const finalAudioBuffer = await streamToBuffer(audioStream);

await Matrix.sendMessage(m.from, { image: { url: thumbnailUrl }, caption: `Title: ${title}\nAuther: ${author}\nDuration: ${duration}\n> © Powered by 𝞢𝙏𝞖𝞘𝞦-𝞛𝘿`}, { quoted: m });
await Matrix.sendMessage(m.from, { image: { url: thumbnailUrl }, caption: `Title: ${title}\nAuther: ${author}\nDuration: ${duration}\n> © Powered by ʜᴀɴꜱᴀᴍᴀʟ-ᴍᴅ`}, { quoted: m });

await Matrix.sendMessage(m.from, { audio: finalAudioBuffer, mimetype: 'audio/mpeg' }, { quoted: m });
} else {

const videoStream = ytdl(videoUrl, { filter: 'audioandvideo', quality: 'highest' });
const finalVideoBuffer = await streamToBuffer(videoStream);

await Matrix.sendMessage(m.from, { video: finalVideoBuffer, mimetype: 'video/mp4', caption: `Title: ${title}\nAuther: ${author}\nDuration: ${duration}\n\n> Powered by Ethix-MD` }, { quoted: m });
await Matrix.sendMessage(m.from, { video: finalVideoBuffer, mimetype: 'video/mp4', caption: `Title: ${title}\nAuther: ${author}\nDuration: ${duration}\n\n> Powered by ʜᴀɴꜱᴀᴍᴀʟ-ᴍᴅ` }, { quoted: m });
}
} catch (error) {
console.error("Error fetching video details:", error);
Expand Down

0 comments on commit 5f116ef

Please sign in to comment.