forked from AsmSafone/MegaDL-Bot
-
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.
Library Changed Rewritten Whole Code Performance Improved Now Can Handle Multi Task Added Progress For Download & Upload
- Loading branch information
0 parents
commit 4203e6b
Showing
12 changed files
with
1,414 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 main.py |
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,79 @@ | ||
# MegaDL-Bot | ||
![GitHub Repo stars](https://img.shields.io/github/stars/AsmSafone/MegaDL-Bot?color=blue&style=flat) | ||
![GitHub forks](https://img.shields.io/github/forks/AsmSafone/MegaDL-Bot?color=green&style=flat) | ||
![GitHub issues](https://img.shields.io/github/issues/AsmSafone/MegaDL-Bot) | ||
![GitHub closed issues](https://img.shields.io/github/issues-closed/AsmSafone/MegaDL-Bot) | ||
![GitHub pull requests](https://img.shields.io/github/issues-pr/AsmSafone/MegaDL-Bot) | ||
![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/AsmSafone/MegaDL-Bot) | ||
![GitHub contributors](https://img.shields.io/github/contributors/AsmSafone/MegaDL-Bot?style=flat) | ||
![GitHub repo size](https://img.shields.io/github/repo-size/AsmSafone/MegaDL-Bot?color=red) | ||
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/AsmSafone/MegaDL-Bot) | ||
![GitHub](https://img.shields.io/github/license/AsmSafone/MegaDL-Bot) | ||
[![Bot Support](https://img.shields.io/badge/MegaDL-Bot%20Support%20Group-blue)](https://t.me/safothebot) | ||
|
||
A Simple Telegram Bot By @AsmSafone to Download Files From Mega.nz and Upload It to Telegram | ||
|
||
# Features | ||
- No Login Required | ||
- All Mega.nz File Links Supported | ||
- Show Live Status On Bot Logs Channel | ||
- Can Force Users To Subscribe To Updates Channel | ||
- Auto Detect File Type Before Upload to Telegram | ||
- Can Add Caption To Any Telegram Media Files | ||
- And More Features Coming Soon ... | ||
|
||
# Demo | ||
<a href="https://t.me/Mega_DLRobot"><img src="https://img.shields.io/badge/MegaDL_Bot-2cb6e0?style=for-the-badge&logo=telegram&logoColor=white"></a> | ||
|
||
# Deploy | ||
Deploy Your Own Bot ♥️ **Star 🌟 Fork 🍴 & Deploy** | ||
|
||
### Heroku | ||
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/AsmSafone/MegaDL-Bot) | ||
|
||
### Self Host | ||
|
||
- Clone the Repo | ||
``` | ||
git clone https://github.com/AsmSafone/MegaDL-Bot | ||
``` | ||
- Enter the directory | ||
``` | ||
cd MegaDL-Bot | ||
``` | ||
- Install Requirements | ||
``` | ||
pip3 install -r requirements.txt | ||
``` | ||
- Run the Bot | ||
``` | ||
python3 main.py | ||
``` | ||
|
||
# License | ||
``` | ||
MegaDL-Bot, An Telegram Bot Project | ||
Copyright (c) 2021 Asm Safone <https://github.com/AsmSafone> | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <https://www.gnu.org/licenses/> | ||
``` | ||
|
||
# Support | ||
<a href="https://t.me/safothebot"><img src="https://img.shields.io/badge/Support_Group-2cb6e0?style=for-the-badge&logo=telegram&logoColor=white"></a> <a href="https://t.me/AsmSafone"><img src="https://img.shields.io/badge/Updates_Channel-2cb6e0?style=for-the-badge&logo=telegram&logoColor=white"></a> | ||
|
||
# Credits | ||
- Dan [For Pyrogram] | ||
- Asm Safone [For This Project] | ||
- O'Dwyer Software [For Mega.py] | ||
- Itz Fork [For Detect File Type Func] |
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,59 @@ | ||
{ | ||
"name": "MegaDL Bot", | ||
"description": "Simple Telegram Bot to download files from Mega.nz", | ||
"logo": "https://telegra.ph/file/583f46da57641b90c28f9.png", | ||
"keywords": [ | ||
"megadl", | ||
"telegram", | ||
"mega.nz bot" | ||
], | ||
"website": "https://t.me/safothebot", | ||
"repository": "https://github.com/AsmSafone/MegaDL-Bot", | ||
"success_url": "https://t.me/AsmSafone", | ||
"env": { | ||
"API_ID": { | ||
"description": "Your API_ID from my.telegram.org", | ||
"required": true | ||
}, | ||
"API_HASH": { | ||
"description": "Your API_HASH from my.telegram.org", | ||
"required": true | ||
}, | ||
"OWNER_ID": { | ||
"description": "Your Telegram ID from @Find_TGIDbot", | ||
"required": true | ||
}, | ||
"BOT_TOKEN": { | ||
"description": "Your Bot Token. Get it from @BotFather", | ||
"required": true | ||
}, | ||
"LOG_CHANNEL": { | ||
"description": "Your Logs/ Status Channel ID. Get it from @Find_TGIDbot", | ||
"required": true | ||
}, | ||
"UPDATES_CHANNEL": { | ||
"description": "Your Updates Channel ID For ForceSub. Get it from @Find_TGIDbot", | ||
"required": false | ||
}, | ||
"LOG_CHANNEL_UNAME": { | ||
"description": "Your Bot Logs / Status Channel Username without @", | ||
"required": true | ||
} | ||
}, | ||
"addons": [], | ||
"buildpacks": [ | ||
{ | ||
"url": "heroku/python" | ||
}, | ||
{ | ||
"url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git" | ||
} | ||
], | ||
"formation": { | ||
"worker": { | ||
"quantity": 1, | ||
"size": "free" | ||
} | ||
}, | ||
"stack": "heroku-20" | ||
} |
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,51 @@ | ||
# (c) Asm Safone | ||
# A Part of MegaDL-Bot <https://github.com/AsmSafone/MegaDL-Bot> | ||
|
||
|
||
import os | ||
|
||
class Config: | ||
API_ID = int(os.environ.get("API_ID", 123)) | ||
API_HASH = os.environ.get("API_HASH", "") | ||
BOT_TOKEN = os.environ.get("BOT_TOKEN", "") | ||
DOWNLOAD_LOCATION = "./DOWNLOADS" | ||
TG_MAX_SIZE = 2040108421 | ||
OWNER_ID = int(os.environ.get("OWNER_ID", 1316963576)) | ||
LOG_CHANNEL = int(os.environ.get("LOG_CHANNEL")) | ||
UPDATES_CHANNEL = os.environ.get("UPDATES_CHANNEL", None) | ||
LOG_CHANNEL_UNAME = os.environ.get("LOG_CHANNEL_UNAME", "") | ||
|
||
|
||
class TEXT: | ||
ABOUT = """ | ||
🤖 **Name:** {bot_name} | ||
📝 **Language:** [Python](https://www.python.org) | ||
📚 **Library:** [Pyrogram](https://docs.pyrogram.org) | ||
📡 **Hosted On:** [Heroku](https://heroku.com) | ||
🧑💻 **Maintainer:** {bot_owner} | ||
👥 **Support Group:** [SafoTheBot](https://t.me/safothebot) | ||
📢 **Updates Channel:** [S1 BOTS](https://t.me/AsmSafone) | ||
""" | ||
|
||
HELP_USER = """ | ||
This is **{bot_name}** | ||
This Bot Can Download Files & Videos From Mega Links & Upload To Telegram. Just Send Any Mega.nz Link & See The Magic. You Can Also Add or Change Caption: Just Select An Uploaded File/ Video or Forward Me Any Telegram File & Then Write The Text You Want To Be Caption On The File As A Reply To That File & The Text You Wrote Will Be Attached As Caption 😁! | ||
**Made With ❤️ By @AsmSafone! 👑** | ||
""" | ||
|
||
START_TEXT = """ | ||
👋🏻 **Hi** {user_mention}, | ||
I'm **{bot_name}** | ||
I Can Download Files & Videos From Mega.nz Links & Upload To Telegram. Please Check Help To Learn More 😉! | ||
**Maintained By: {bot_owner}**❤️! | ||
""" |
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,21 @@ | ||
# (c) Asm Safone | ||
# A Part of MegaDL-Bot <https://github.com/AsmSafone/MegaDL-Bot> | ||
|
||
import os | ||
import asyncio | ||
from pyrogram import Client, idle | ||
from config import Config | ||
|
||
if __name__ == "__main__" : | ||
if not os.path.isdir(Config.DOWNLOAD_LOCATION): | ||
os.makedirs(Config.DOWNLOAD_LOCATION) | ||
plugins = dict(root="megadl") | ||
app = Client( | ||
"MegaDL-Bot", | ||
bot_token=Config.BOT_TOKEN, | ||
api_id=Config.API_ID, | ||
api_hash=Config.API_HASH, | ||
plugins=plugins | ||
) | ||
app.start() | ||
idle() |
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,14 @@ | ||
# (c) Asm Safone | ||
# A Part of MegaDL-Bot <https://github.com/AsmSafone/MegaDL-Bot> | ||
|
||
import os | ||
from config import Config | ||
from pyrogram import Client, filters | ||
|
||
@Client.on_message(filters.reply & filters.text & filters.private & ~filters.edited) | ||
async def caption(bot, message): | ||
file = message.reply_to_message | ||
if file.media and not (file.video_note or file.sticker): | ||
await file.copy(message.chat.id, caption=message.text) | ||
else: | ||
return |
Oops, something went wrong.