import axios from "axios"; export default { command: ["تيك", "tiktok", "تيكتوك", "tt"], description: "تحميل فيديوهات تيك توك بدون علامة مائية", category: "التحميل", handler: async (sock, mek, { from, q, prefix, command }) => { // التحقق من وجود الرابط if (!q) { return await sock.sendMessage( from, { text: `> 📌 مثال للاستخدام:\n> *${prefix + command} https://vm.tiktok.com/...*` }, { quoted: mek } ); } // التحقق أن الرابط يخص منصة تيك توك if (!q.includes("tiktok.com")) { return await sock.sendMessage( from, { text: `⚠️ من فضلك أرسل رابط تيك توك صحيح.` }, { quoted: mek } ); } // إرسال رسالة انتظار await sock.sendMessage( from, { text: `> ⏳ جاري جلب الفيديو من تيك توك، دقيقة واحدة...` }, { quoted: mek } ); try { // جلب البيانات من API موثوق لتيك توك بدون علامة مائية const response = await axios.get(`https://www.tikwm.com/api/?url=${encodeURIComponent(q)}`); const res = response.data; if (!res || res.code !== 0 || !res.data) { return await sock.sendMessage( from, { text: `❌ فشل في جلب الفيديو، تأكد من صحة الرابط وحاول مرة أخرى.` }, { quoted: mek } ); } const videoData = res.data; const videoUrl = videoData.play; // رابط الفيديو بدون علامة مائية (No Watermark) const title = videoData.title || "فيديو تيك توك"; const author = videoData.author?.nickname || "مجهول"; let caption = `🎬 *TikTok Downloader*\n\n` + `👤 *صاحب الفيديو:* ${author}\n` + `📝 *الوصف:* ${title}\n\n` + `> VOX BOT`; // إرسال الفيديو للمستخدم await sock.sendMessage( from, { video: { url: videoUrl }, caption: caption }, { quoted: mek } ); } catch (err) { console.error("TikTok Error:", err.message); await sock.sendMessage( from, { text: `❌ حدث خطأ أثناء تحميل الفيديو، حاول لاحقاً.` }, { quoted: mek } ); } } };