-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmain.py
More file actions
39 lines (34 loc) · 1.25 KB
/
main.py
File metadata and controls
39 lines (34 loc) · 1.25 KB
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
# ©riz4d
import requests as req
import wget
import os
from pyrogram import *
from Config import *
base_url='https://api.xteam.xyz/dl/mediafire?url='
endpoint='&APIKEY='
app=Client('',
api_id=API_ID,
api_hash=API_HASH,
bot_token=BOT_TOKEN)
@app.on_message(filters.command('start'))
async def start_msg(client,message):
await message.reply('**Hey '+message.from_user.first_name+" 🖐**\n\nI can download MediaFire files by senting MediaFire URL\n\nExample URL :\n`https://www.mediafire.com/file/gqgz18jsaic3bbb/test_img.png/file`\n\n\nDev : @riz4d")
@app.on_message(filters.text)
async def media_dl(client,message):
try:
Input=message.text
url=base_url+Input+endpoint+API_KEY
request_url=req.get(url)
req_js=request_url.json()
FileName=req_js['result']['title']
FileSize=req_js['result']['size']
await message.reply("**<u>File InFo</u>\n\n__File Name : `"+FileName+"`\nFile Size : `"+FileSize+"`__**")
down=req_js['result']['url']
file=wget.download(down)
await message.reply_photo(file)
os.remove(file)
except:
await message.reply('**__Sorry, Its Invalid Mediafire URL try again__**')
await message.reply("__Further Queries @riz4d__")
app.run()
# writtened by @riz4d