Skip to content

Instantly share code, notes, and snippets.

@Mr-rabbit-xd
Last active March 21, 2025 18:59
Show Gist options
  • Save Mr-rabbit-xd/0eeba41d1d6837fff3a5ce5c6b658de4 to your computer and use it in GitHub Desktop.
Save Mr-rabbit-xd/0eeba41d1d6837fff3a5ce5c6b658de4 to your computer and use it in GitHub Desktop.
const { instagram, bot, lang } = require('../lib/')
System({
pattern: 'fb ?(.*)',
fromMe: isPrivate,
type: 'download',
alias: ['facebook'],
desc: 'Download Facebook video with caption'
}, async (message, text) => {
var match = (await extractUrlsFromText(text || message.reply_message?.text))[0];
if (!match) return await message.reply("*Need a Facebook public media link*\n_Example: .fb_\n*NOTE: ONLY VIDEO LINK*");
const { result } = await getJson(api + "download/facebook?url=" + match);
if (!result || (!result.hd && !result.sd)) return await message.reply("Could not fetch video. Please check the link.");
// ক্যাপশন নিয়ে আসা
const captionText = result.caption ? `*Caption:* ${result.caption}\n\nDOWNLOAD BY MR- Rabbit` : "DOWNLOAD BY MR- Rabbit";
if (!message.isGroup) {
return await message.sendFromUrl(result.hd, { quoted: message.data, caption: captionText });
}
await message.send("Choose Quality", {
values: [
{ displayText: "HD", id: `sendurl ${result.hd} ${captionText}` },
{ displayText: "SD", id: `sendurl ${result.sd} ${captionText}` }
],
onlyOnce: true,
withPrefix: true,
participates: [message.sender]
}, "poll");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment