-
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
10 changed files
with
185 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
worker: python3 -m bot |
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,13 @@ | ||
#!/usr/bin/env python3 | ||
# This is bot coded by Abhijith-cloud and used for educational purposes only | ||
# https://github.com/Abhijith-cloud | ||
# (c) Abhijith N T ;-) | ||
# Thank you https://github.com/pyrogram/pyrogram :-) | ||
|
||
import os | ||
|
||
class msg(): | ||
source = "\nsource:https://github.com/Abhijith-cloud/Telegram-MixDrop-Bot" | ||
start = "\n<b>@thankappan369</b>" | ||
error = "something is went wrong\n{error} \ncontact admin @thankappan369" | ||
help = "" |
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,20 @@ | ||
#!/usr/bin/env python3 | ||
# This is bot coded by Abhijith-cloud and used for educational purposes only | ||
# https://github.com/Abhijith-cloud | ||
# (c) Abhijith N T ;-) | ||
# Thank you https://github.com/pyrogram/pyrogram :-) | ||
|
||
|
||
from pyrogram import Client | ||
# from env import ev_data | ||
|
||
bot = Client( | ||
"Telegram MixDrop Bot", | ||
bot_token = "", #ev_data.BOT_TOKEN | ||
api_id = 1234, #ev_data.API_ID | ||
api_hash = "", #ev_data.API_HASH, | ||
plugins = { | ||
"root":"bot/plugins" | ||
} | ||
) | ||
bot.run() |
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,19 @@ | ||
from pyrogram import Client,filters | ||
from bot import msg | ||
|
||
@Client.on_message(filters.command(["start"])) | ||
async def start(client, message): | ||
await client.send_message( | ||
chat_id=message.chat.id, | ||
text=f"Hey {message.from_user.first_name},{msg.start}{msg.source}", | ||
reply_to_message_id=message.message_id, | ||
parse_mode = "html" | ||
) | ||
@Client.on_message(filters.command(["help","h"])) | ||
async def help(client, message): | ||
await client.send_message( | ||
chat_id=message.chat.id, | ||
text=f"Hey {message.from_user.first_name},{msg.help}{msg.source}", | ||
reply_to_message_id=message.message_id, | ||
parse_mode = "html" | ||
) |
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,17 @@ | ||
#!/usr/bin/env python3 | ||
# This is bot coded by Abhijith-cloud and used for educational purposes only | ||
# https://github.com/Abhijith-cloud | ||
# (c) Abhijith N T ;-) | ||
# Thank you https://github.com/pyrogram/pyrogram :-) | ||
|
||
from bot.plugins.display.time import time_data | ||
|
||
async def progress(current, total,up_msg, message, start_time): | ||
|
||
try: | ||
await message.edit( | ||
text = f"{up_msg} {current * 100 / total:.1f}% in {time_data(start_time)}" | ||
) | ||
except: | ||
pass | ||
|
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,19 @@ | ||
import time | ||
|
||
def time_data(start_time): | ||
end = time.time() | ||
now = end - start_time | ||
now_time = now | ||
day = now_time // (24 * 3600) | ||
now_time = now_time % (24 * 3600) | ||
hour = now_time // 3600 | ||
now_time %= 3600 | ||
minutes = now_time // 60 | ||
now_time %= 60 | ||
seconds = now_time | ||
if(day!=0): | ||
return "%dd %dh %dm %ds" % (day, hour, minutes, seconds) | ||
if(hour!=0): | ||
return "%dh %dm %ds" % (hour, minutes, seconds) | ||
else: | ||
return "%dm %ds" % (minutes, seconds) |
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,61 @@ | ||
#!/usr/bin/env python3 | ||
# This is bot coded by Abhijith-cloud and used for educational purposes only | ||
# https://github.com/Abhijith-cloud | ||
# (c) Abhijith N T ;-) | ||
# Thank you https://github.com/pyrogram/pyrogram :-) | ||
|
||
from pyrogram import Client,filters | ||
from pyrogram.types.messages_and_media.message import Message | ||
from bot.plugins.helpers.mixdrop_upload import mixFileup | ||
from bot.plugins.display import progress | ||
import time, os | ||
from hurry.filesize import size | ||
from pyrogram.types import ( | ||
InlineKeyboardMarkup, | ||
InlineKeyboardButton | ||
) | ||
|
||
@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 | ||
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) | ||
except Exception as error: | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from logging import error | ||
import aiohttp | ||
from bot.plugins.display.time import time_data | ||
|
||
async def mixFileup(file, bot, s_time): | ||
#https://github.com/odysseusmax/uploads/blob/master/mixdrop.py | ||
try: | ||
await bot.edit( | ||
text = "Uploadig to MixDrop.." | ||
) | ||
email = "[email protected]" | ||
api_key = "TUtD1QIPwPyaoHql14C" | ||
upload_url = "https://ul.mixdrop.co/api" | ||
async with aiohttp.ClientSession() as session: | ||
file_to_upload = file | ||
data = { | ||
'file': open(file_to_upload, 'rb'), | ||
'email': email, | ||
'key': api_key | ||
} | ||
response = await session.post(upload_url, data=data) | ||
link = await response.json() | ||
await bot.edit( | ||
text = f"Uploaded...100% in {time_data(s_time)}" | ||
) | ||
return f"https://mixdrop.co/f/{link['result']['fileref']}" | ||
except Exception as eror: | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Pyrogram | ||
TgCrypto | ||
aiohttp | ||
hurry.filesize |
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 @@ | ||
python-3.9.1 |