Logo and Youtube Media Download Plugins
Logo, YouTube Video, and MP3 Download Plugins are powerful tools designed to help users easily access, download, and manage multimedia content in a smooth and efficient way. The logo download plugin allows users to quickly find and save high-quality brand logos in various formats for design, branding, or creative projects. The YouTube video download plugin enables users to download videos directly from YouTube in different resolutions for offline viewing or content reuse. Meanwhile, the MP3 download plugin makes it simple to extract and download audio files from videos or online sources, allowing users to enjoy music, podcasts, and soundtracks anytime. Together, these plugins provide a complete solution for downloading and organizing visual and audio content with ease and flexibility.
1. ytdown.js
const { cmd } = require("../command");
const { ytmp3, ytmp4, tiktok } = require("sadaslk-dlcore");
const yts = require("yt-search");
async function getYoutube(query) {
const isUrl = /(youtube\.com|youtu\.be)/i.test(query);
if (isUrl) {
const id = query.split("v=")[1] || query.split("/").pop();
const info = await yts({ videoId: id });
return info;
}
const search = await yts(query);
if (!search.videos.length) return null;
return search.videos[0];
}
cmd(
{
pattern: "ytmp3",
alias: ["yta", "song"],
desc: "Download YouTube MP3 by name or link",
category: "download",
filename: __filename,
},
async (bot, mek, m, { from, q, reply }) => {
try {
if (!q) return reply("🎵 Send song name or YouTube link");
reply("🔎 Searching YouTube...");
const video = await getYoutube(q);
if (!video) return reply("❌ No results found");
const caption =
`🎵 *${video.title}*\n\n` +
`👤 Channel: ${video.author.name}\n` +
`⏱ Duration: ${video.timestamp}\n` +
`👀 Views: ${video.views.toLocaleString()}\n` +
`🔗 ${video.url}`;
await bot.sendMessage(
from,
{
image: { url: video.thumbnail },
caption,
},
{ quoted: mek }
);
reply("⬇️ Downloading MP3...");
const data = await ytmp3(video.url);
if (!data?.url) return reply("❌ Failed to download MP3");
await bot.sendMessage(
from,
{
audio: { url: data.url },
mimetype: "audio/mpeg",
},
{ quoted: mek }
);
} catch (e) {
console.log("YTMP3 ERROR:", e);
reply("❌ Error while downloading MP3");
}
}
);
cmd(
{
pattern: "ytmp4",
alias: ["ytv", "video"],
desc: "Download YouTube MP4 by name or link",
category: "download",
filename: __filename,
},
async (bot, mek, m, { from, q, reply }) => {
try {
if (!q) return reply("🎬 Send video name or YouTube link");
reply("🔎 Searching YouTube...");
const video = await getYoutube(q);
if (!video) return reply("❌ No results found");
const caption =
`🎬 *${video.title}*\n\n` +
`👤 Channel: ${video.author.name}\n` +
`⏱ Duration: ${video.timestamp}\n` +
`👀 Views: ${video.views.toLocaleString()}\n` +
`📅 Uploaded: ${video.ago}\n` +
`🔗 ${video.url}`;
await bot.sendMessage(
from,
{
image: { url: video.thumbnail },
caption,
},
{ quoted: mek }
);
reply("⬇️ Downloading video...");
const data = await ytmp4(video.url, {
format: "mp4",
videoQuality: "360",
});
if (!data?.url) return reply("❌ Failed to download video");
await bot.sendMessage(
from,
{
video: { url: data.url },
mimetype: "video/mp4",
fileName: data.filename || "youtube_video.mp4",
caption: "🎬 YouTube video",
gifPlayback: false,
},
{ quoted: mek }
);
} catch (e) {
console.log("YTMP4 ERROR:", e);
reply("❌ Error while downloading video");
}
}
);
cmd(
{
pattern: "tiktok",
alias: ["tt"],
desc: "Download TikTok video",
category: "download",
filename: __filename,
},
async (bot, mek, m, { from, q, reply }) => {
try {
if (!q) return reply("📱 Send TikTok link");
reply("⬇️ Downloading TikTok video...");
const data = await tiktok(q);
if (!data?.no_watermark)
return reply("❌ Failed to download TikTok video");
const caption =
`🎵 *${data.title || "TikTok Video"}*\n\n` +
`👤 Author: ${data.author || "Unknown"}\n` +
`⏱ Duration: ${data.runtime}s`;
await bot.sendMessage(
from,
{
video: { url: data.no_watermark },
caption,
},
{ quoted: mek }
);
} catch (e) {
console.log("TIKTOK ERROR:", e);
reply("❌ Error while downloading TikTok video");
}
}
);
2. logo.js

0 Comments