Skip to content

Commit

Permalink
Update downloader-facebook.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilsmac authored Oct 23, 2023
1 parent b194f81 commit 6234206
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions plugins/downloader-facebook.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import fbDownloader from 'fb-downloader-scrapper';
import {facebook} from '@xct007/frieren-scraper';
import axios from 'axios';
const handler = async (m, {conn, args, command, usedPrefix}) => {
if (!args[0]) throw `*[❗𝐈𝐍𝐅𝐎❗] 𝙸𝙽𝙶𝚁𝙴𝚂𝙴 𝚄𝙽 𝙴𝙽𝙻𝙰𝙲𝙴 𝙳𝙴 𝙵𝙰𝙲𝙴𝙱𝙾𝙾𝙺, 𝙴𝙹𝙴𝙼𝙿𝙻𝙾: ${usedPrefix + command}* https://fb.watch/fOTpgn6UFQ/`;
if (!args[0].match(/www.facebook.com|fb.watch/g)) throw `*[❗𝐈𝐍𝐅𝐎❗] 𝙸𝙽𝙶𝚁𝙴𝚂𝙴 𝚄𝙽 𝙴𝙽𝙻𝙰𝙲𝙴 𝙳𝙴 𝙵𝙰𝙲𝙴𝙱𝙾𝙾𝙺, 𝙴𝙹𝙴𝙼𝙿𝙻𝙾: ${usedPrefix + command}* https://fb.watch/fOTpgn6UFQ/`;
if (!args[0]) throw `*[INFORMACIÓN] 𝐼𝑁𝐺𝑅𝐸𝑆𝐸 𝑈𝑁 𝐸𝑁𝐿𝐴𝐶𝐸 𝐷𝐸 𝐹𝐴𝐶𝐸𝐵𝑂𝑂𝐾, 𝐸𝐽𝐸𝑀𝑃𝐿𝑂: ${usedPrefix + command}* https://fb.watch/fOTpgn6UFQ/`;
if (!args[0].match(/www.facebook.com|fb.watch/g)) throw `*[IFORMACÍON] 𝐼𝑁𝐺𝑅𝐸𝑆𝐸 𝑈𝑁 𝐸𝑁𝐿𝐴𝐶𝐸 𝐷𝐸 𝐹𝐴𝐶𝐸𝐵𝑂𝑂𝐾, 𝐸𝐽𝐸𝑀𝑃𝐿𝑂: ${usedPrefix + command}* https://fb.watch/fOTpgn6UFQ/`;
try {
await m.reply(`*[❗] ᴅᴇsᴄᴀʀɢᴀɴᴅᴏ sᴜ ᴠɪᴅᴇᴏ, ᴀɢᴜᴀʀᴅᴇ ᴜɴ ᴍᴏᴍᴇɴᴛᴏ ᴘᴏʀ ғᴀᴠᴏʀ, ᴇsᴛᴇ ᴘʀᴏᴄᴇsᴏ ᴘᴜᴇᴅᴇ ᴅᴜʀᴀʀ ᴇɴᴛʀᴇ 2 ʏ 10 ᴍɪɴᴜᴛᴏs ᴅᴇᴘᴇɴᴅɪᴇɴᴅᴏ ᴅᴇ ʟᴀ ᴅᴜʀᴀᴄɪᴏɴ ᴅᴇʟ ᴠɪᴅᴇᴏ...*`);
await m.reply(`*[✰] 𝑑𝑒𝑠𝑐𝑎𝑟𝑔𝑎𝑛𝑑𝑜 𝑠𝑢 𝑣𝑖𝑑𝑒𝑜, 𝐸𝑠𝑝𝑒𝑟𝑒́ 𝑢𝑛 𝑚𝑜𝑚𝑒𝑛𝑡𝑜 𝑝𝑜𝑟 𝑓𝑎𝑣𝑜𝑟*`);
const d2ata = await facebook.v1(args[0]);
let r2es = '';
if (d2ata.urls && d2ata.urls.length > 0) {
r2es = `${d2ata.urls[0]?.hd || d2ata.urls[1]?.sd || ''}`;
}
conn.sendFile(m.chat, r2es, 'error.mp4', `*𝙰𝚀𝚄𝙸 𝙴𝚂𝚃𝙰 𝚂𝚄 𝚅𝙸𝙳𝙴𝙾*`, m);
conn.sendFile(m.chat, r2es, 'error.mp4', `*۞𝐴𝑄𝑈𝐼 𝐸𝑆𝑇𝐴 𝑆𝑈 𝑉𝐼𝐷𝐸𝑂۞*`, m);
} catch (err1) {
try {
const req = await igeh(args[0]);
Expand All @@ -30,26 +30,26 @@ const handler = async (m, {conn, args, command, usedPrefix}) => {
try {
const ress = await fg.fbdl(args[0]);
const urll = await ress.data[0].url;
await conn.sendFile(m.chat, urll, 'error.mp4', '*𝙰𝚀𝚄𝙸 𝙴𝚂𝚃𝙰 𝚂𝚄 𝚅𝙸𝙳𝙴𝙾*', m);
await conn.sendFile(m.chat, urll, 'error.mp4', '*𝐴𝑄𝑈𝐼 𝐸𝑆𝑇𝐴 𝑆𝑈 𝑉𝐼𝐷𝐸𝑂*', m);
} catch (err3) {
try {
const res = await fbDownloader(args[0]);
for (const result of res.download) {
const ur = result.url;
await conn.sendFile(m.chat, ur, 'error.mp4', '*𝙰𝚀𝚄𝙸 𝙴𝚂𝚃𝙰 𝚂𝚄 𝚅𝙸𝙳𝙴𝙾*', m);
await conn.sendFile(m.chat, ur, 'error.mp4', '*𝐴𝑄𝑈𝐼 𝐸𝑆𝑇𝐴 𝑆𝑈 𝑉𝐼𝐷𝐸𝑂*', m);
}
} catch (err4) {
try {
const res3 = await fetch(`https://latam-api.vercel.app/api/facebookdl?apikey=nekosmic&q=${args[0]}`);
const json = await res3.json();
const url3 = await json.video;
await conn.sendFile(m.chat, url3, 'error.mp4', '*𝙰𝚀𝚄𝙸 𝙴𝚂𝚃𝙰 𝚂𝚄 𝚅𝙸𝙳𝙴𝙾*', m);
await conn.sendFile(m.chat, url3, 'error.mp4', '*𝐴𝑄𝑈𝐼 𝐸𝑆𝑇𝐴 𝑆𝑈 𝑉𝐼𝐷𝐸𝑂*', m);
} catch (err5) {
try {
const {result} = await facebookdl(args[0]).catch(async (_) => await facebookdlv2(args[0])).catch(async (_) => await savefrom(args[0]));
for (const {url, isVideo} of result.reverse()) await conn.sendFile(m.chat, url, `facebook.${!isVideo ? 'bin' : 'mp4'}`, '*𝙰𝚀𝚄𝙸 𝙴𝚂𝚃𝙰 𝚂𝚄 𝚅𝙸𝙳𝙴𝙾*', m);
for (const {url, isVideo} of result.reverse()) await conn.sendFile(m.chat, url, `facebook.${!isVideo ? 'bin' : 'mp4'}`, '*𝐴𝑄𝑈𝐼 𝐸𝑆𝑇𝐴 𝑆𝑈 𝑉𝐼𝐷𝐸𝑂*', m);
} catch (err6) {
throw `*[❗𝐈𝐍𝐅𝐎❗] 𝙴𝚁𝚁𝙾𝚁, 𝙿𝙾𝚁 𝙵𝙰𝚅𝙾𝚁 𝚅𝚄𝙴𝙻𝚅𝙰 𝙰 𝙸𝙽𝚃𝙴𝙽𝚃𝙰𝚁𝙻𝙾*`;
throw `*[INFORMACIÓN] 𝐸𝑅𝑅𝑂𝑅, 𝑃𝑂𝑅 𝐹𝐴𝑉𝑂𝑅 𝑉𝑈𝐸𝐿𝑉𝐴 𝐴 𝐼𝑁𝑇𝐸𝑁𝑇𝐴𝑅𝐿𝑂*`;
}
}
}
Expand Down

0 comments on commit 6234206

Please sign in to comment.