Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import axios from 'axios'
- let handler = async (m, { conn, args, usedPrefix, command }) => {
- if (!args[0]) throw `Use example ${usedPrefix}${command} https://www.facebook.com/reel/634413131779357/`
- let res = await facebookDl(args[0])
- let url = res?.url?.[1]?.url || res?.url?.[0]?.url || res?.hd?.url || res?.sd?.url
- if (!url) throw 'Can\'t download the post'
- await m.reply('_In progress, please wait..._')
- conn.sendMessage(m.chat, { video: { url }, caption: res?.meta?.title || '' }, { quoted: m })
- }
- handler.help = ['facebook'].map(v => v + ' <url>')
- handler.tags = ['downloader']
- handler.command = /^((facebook|fb)(downloder|dl)?)$/i
- export default handler
- async function facebookDl(url) {
- let resp = await axios.post('https://ssyoutube.com/api/convert', { url }).catch(e => e.response)
- return resp.data
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement