const axios = require("axios") const pluginConfig = { name: 'ytmp4', alias: ['youtubemp4', 'ytvideo', 'yt4'], category: 'download', description: 'Download video YouTube', usage: '.ytmp4 ', example: '.ytmp4 https://youtube.com/watch?v=xxx', cooldown: 20, energi: 1, isEnabled: true } async function handler(m, { sock }) { const url = m.text?.trim() if (!url) return m.reply(`Contoh: ${m.prefix}ytmp4 https://youtube.com/watch?v=xxx`) if (!url.includes('youtube.com') && !url.includes('youtu.be')) return m.reply('❌ URL harus YouTube') m.react('🕕') try { const { data } = await axios.get(`https://api.nexray.web.id/downloader/ytmp4?url=${url}&resolusi=720`) await sock.sendMedia(m.chat, data.result.url, data.result.title, m, { type: 'video', }) m.react('✅') } catch (err) { console.error('[YTMP4]', err) m.react('❌') m.reply('Gagal mengunduh video.') } } module.exports = { config: pluginConfig, handler }