-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
280 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
#!/usr/bin/env python3 | ||
# This is bot coded by Abhijith-cloud and used for educational purposes only | ||
# https://github.com/Abhijith-cloud | ||
# Copyright ABHIJITH N T | ||
# Thank you https://github.com/pyrogram/pyrogram | ||
|
||
from pyrogram import Client | ||
from bot import LOGGER | ||
import pyrogram | ||
from bot.plugins.helpers.dowloader import fileDownload | ||
|
||
@Client.on_callback_query() | ||
async def server_selection(client, server): | ||
await fileDownload(client, server) | ||
await fileDownload(client, server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
#!/usr/bin/env python3 | ||
# This is bot coded by Abhijith-cloud and used for educational purposes only | ||
# https://github.com/Abhijith-cloud | ||
# Copyright ABHIJITH N T | ||
# Thank you https://github.com/pyrogram/pyrogram | ||
|
||
from pyrogram import Client,filters | ||
from bot import LOGGER | ||
from hurry.filesize import size | ||
from bot.plugins.keybord import server_select | ||
|
||
@Client.on_message(filters.video) | ||
async def userVideo(client, bot): | ||
LOGGER.info(f"{bot.chat.id} - {bot.video.file_name}") | ||
await client.send_message( | ||
chat_id=bot.chat.id, | ||
text = ( | ||
f"File Name: <code>{bot.video.file_name}</code>" | ||
f"\nFile Size: <code>{size(bot.video.file_size)}</code>" | ||
), | ||
reply_markup=server_select(), | ||
reply_to_message_id=bot.message_id | ||
) | ||
@Client.on_message(filters.document) | ||
async def userDocument(client, bot): | ||
LOGGER.info(f"{bot.chat.id} - {bot.document.file_name}") | ||
await client.send_message( | ||
chat_id=bot.chat.id, | ||
text = ( | ||
f"File Name: <code>{bot.document.file_name}</code>" | ||
f"\nFile Size: <code>{size(bot.document.file_size)}</code>" | ||
), | ||
reply_markup=server_select(), | ||
reply_to_message_id=bot.message_id | ||
) | ||
@Client.on_message(filters.audio) | ||
async def userAudio(client, bot): | ||
LOGGER.info(f"{bot.chat.id} - {bot.audio.file_name}") | ||
await client.send_message( | ||
chat_id=bot.chat.id, | ||
text = ( | ||
f"File Name: <code>{bot.audio.file_name}</code>" | ||
f"\nFile Size: <code>{size(bot.audio.file_size)}</code>" | ||
), | ||
reply_markup=server_select(), | ||
reply_to_message_id=bot.message_id | ||
) | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
# @Client.on_message(filters.media) | ||
# async def userMedia(client, bot): | ||
# now = time.time() | ||
# link = '' | ||
# f_size = '' | ||
# f_name = '' | ||
# file = '' | ||
|
||
# userMsg = await client.send_message( | ||
# chat_id=bot.chat.id, | ||
# text = "processing your request...please wait" | ||
# ) | ||
|
||
# try: | ||
# file = await bot.download( | ||
# progress = progress, | ||
# progress_args = ( | ||
# 'Downloading....', | ||
# userMsg, | ||
# now | ||
# ) | ||
# ) | ||
# f_size = os.path.getsize(file) | ||
# f_name = file.split('/')[-1] | ||
# link = await mixFileup(file, userMsg, now) | ||
# for i in link: | ||
# pass | ||
# LOGGER.info(f""" | ||
# Download:{bot.from_user.id}: | ||
# File Name:{f_name} | ||
# Link:{link} | ||
# """) | ||
# except Exception as error: | ||
# print(error) | ||
# await bot.reply( | ||
# text = f""" | ||
# File Name: {f_name} | ||
# \nSIZE: {size(f_size)} | ||
# """, | ||
# reply_markup=InlineKeyboardMarkup( | ||
# [ | ||
# [ | ||
# InlineKeyboardButton( | ||
# "DOWNLOAD !", | ||
# url=f"{link}" | ||
# ), | ||
# ], | ||
# ] | ||
# ) | ||
# ) | ||
# try: | ||
# os.remove(file) | ||
# LOGGER.info(f"{bot.from_user.id} {file} Remove") | ||
# except Exception as error: | ||
# LOGGER.info(f"{file} not Remove") | ||
# print(error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,62 @@ | ||
import requests | ||
import json | ||
from bot.plugins.keybord import downloadButton | ||
#!/usr/bin/env python3 | ||
# This is bot coded by Abhijith-cloud and used for educational purposes only | ||
# https://github.com/Abhijith-cloud | ||
# Copyright ABHIJITH N T | ||
# Thank you https://github.com/pyrogram/pyrogram | ||
|
||
|
||
import aiohttp | ||
import os, time | ||
from hurry.filesize import size | ||
from bot.plugins.display.time import time_data | ||
from pyrogram.errors import FloodWait | ||
from pyrogram.types import ( | ||
InlineKeyboardMarkup, | ||
InlineKeyboardButton | ||
) | ||
|
||
|
||
|
||
async def fileIO(file_name, client, bot, s_time): | ||
print(1) | ||
async def fileIO(file, client, bot, s_time): | ||
file_size = size(os.path.getsize(file)) | ||
file_name = file.split('/')[-1] | ||
try: | ||
await client.edit_message_text( | ||
chat_id=bot.from_user.id, | ||
message_id=bot.message.message_id, | ||
text="Uploadig to File.IO", | ||
text="Uploadig to File.IO" | ||
) | ||
files = { | ||
'file': (file_name, open( file_name, 'rb')), | ||
} | ||
response = requests.post('https://file.io/', files=files) | ||
response = await json.loads(response.text) | ||
dl_b = response['link'] | ||
await downloadButton(dl_b) | ||
await client.edit_message_text( | ||
async with aiohttp.ClientSession() as session: | ||
files = { | ||
'file': open(file, 'rb') | ||
} | ||
response = await session.post('https://file.io/', data=files) | ||
link = await response.json() | ||
dl_b = link['link'] | ||
await client.edit_message_text( | ||
chat_id=bot.from_user.id, | ||
message_id=bot.message.message_id, | ||
text=f"Uploaded...100% in {time_data(s_time)}", | ||
) | ||
await client.client.send_message( | ||
text=f"Uploaded...100% in {time_data(s_time)}" | ||
) | ||
await client.send_message( | ||
chat_id=bot.from_user.id, | ||
text=f"Enjoy Enjoy..", | ||
reply_markup=downloadButton() | ||
text=( | ||
f"File Name: <code>{file_name}</code>" | ||
f"\nFile Size: <code>{file_size}</code>" | ||
), | ||
reply_markup=InlineKeyboardMarkup( | ||
[[ | ||
InlineKeyboardButton( | ||
"🔗 DOWNLOAD URL", | ||
url=f"{dl_b}" | ||
) | ||
], | ||
[ | ||
InlineKeyboardButton( | ||
"🗂 SOURCE", | ||
url = "https://github.com/Abhijith-cloud/" | ||
) | ||
]]) | ||
) | ||
except Exception as error: | ||
print(error) | ||
except FloodWait as error: | ||
print(time.sleep(error.x)) |
Oops, something went wrong.