File size: 1,721 Bytes
21bc372 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
import time
from pyrogram import *
from pyrogram.types import *
from akn import log_detailed_error
from akn.utils.handler import *
from akn.utils.scripts import progress
from akn.utils.prefixprem import command
from akenoai import *
from akenoai.types import DifferentAPIDefault
from config import *
@Akeno(
command(["fbdl"])
& filters.me
& ~filters.forwarded
)
async def fbdowns_and_fdownloader(client: Client, message: Message):
link = message.text.split(" ", 1)[1] if len(message.command) > 1 else None
pro = await message.reply_text("Processing.....")
if not link:
return await pro.edit_text("Please link for facebook.")
if not link.startswith("https://www.facebook.com/"):
return await pro.edit_text("invalid link.")
try:
js = AkenoXJs(DifferentAPIDefault()).connect()
response = await js.downloader.create(
"fb",
params_data={"url": link},
is_obj=True
)
upload_text = f"**β¬οΈ π΄ππ
ππΊπ½πππ video ...**"
await pro.edit_text(upload_text)
await message.reply_video(
response.results.video[0].url,
caption=f"β’ Powered by {client.me.mention}",
progress=progress,
progress_args=(
pro,
time.time(),
upload_text
)
)
await pro.delete()
except Exception as e:
await log_detailed_error(e, where=client.me.id, who=message.chat.title)
await pro.edit_text("Something went wrong, please try again later.")
module = modules_help.add_module("facebook", __file__)
module.add_command("fbdl", "to facebook for link downloading") |