XMYSTERlOUSX / mega-link-downloader-bot

A telegram bot to download mega.nz links. (made with pyrogram).
GNU General Public License v3.0
266 stars 302 forks source link
bot downloader mega mega-links megacmd megatools python telegram telegram-bot uploader

Mega Link Downloader Bot

This is a telegram bot to download mega.nz links and return them as files/videos - Made by a 100% noob!

(When I mean noob I really mean noob!)

You can find a live version of this bot in telegram as @mega_downloader_robot

Created with ❤️ by b>[@xmysteriousx](https://t.me/xmysteriousx)</b as a part of @mysterious_uploader_robot

Please be kind to star and fork this repo!✨😇


Features 💫

Notes :-

  1. Due to telegram API limits I can't upload files which are bigger than 2GB so such files will be spliited and uploaded to you!
  2. Quota limits can occur if you don't provide a pro/business account!
  3. Folder support is not implemented yet but can be added in the near future!

Deploying Methods

Deploying to Heroku
- Examples of needed bot variables are mentioned below in this readme! Note :- Downloads are speed on heroku too! 😍
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/XMYSTERlOUSX/mega-link-downloader-bot)
Deploying on a VPS
**Make an Ubuntu 20.04 (LTS) x64 vps!** (All the commands below are given assuming that you use a Ubuntu 20.04 (LTS) x64 vps!) - Then execute the below commands. 👇 ```sh sudo apt update ``` ```sh sudo apt upgrade ``` ```sh apt-get update ``` ```sh apt-get install tmux ``` ```sh apt install meson ``` ```sh sudo apt-get install libtool libglib2.0-dev gobject-introspection libgmp3-dev nettle-dev asciidoc glib-networking openssl libcurl4-openssl-dev libssl-dev ``` ```sh git clone https://github.com/XMYSTERlOUSX/megatools ``` ```sh cd megatools ``` ```sh meson b ``` ```sh ninja -C b ``` ```sh sudo ninja -C b install ``` ```sh cd ``` ```sh wget https://mega.nz/linux/MEGAsync/xUbuntu_20.04/amd64/megacmd-xUbuntu_20.04_amd64.deb ``` ```sh sudo apt install ./megacmd-xUbuntu_20.04_amd64.deb ``` (Ignore the warning "Download is performed unsandboxed as root as file" if it is shown...Continue with the other steps now!) ```sh tmux ``` **Now there are two methods to go further!** - Method 1 - Fork my repo. In the repo go inside to the `sample_config.py` and copy all the code in it. In your forked repo, create a file named `config.py` and paste the whole code in it. - Then edit the values in it with your values! (Inside your `config.py` file you will see the examples of how to edit the fields.) - Then execute the below commands. 👇 ```sh git clone You_forked_repo_url ``` ```sh apt install python3-pip ``` ```sh apt install ffmpeg ``` ```sh cd mega-link-downloader-bot ``` ```sh pip3 install -r requirements.txt ``` ```sh python3 bot.py ``` Now If you did everything correctly bot will be running successfully! 🥳 - Method 2 - Execute the below commands. 👇 ```sh git clone https://github.com/XMYSTERlOUSX/mega-link-downloader-bot ``` ```sh apt install python3-pip ``` ```sh apt install ffmpeg ``` ```sh cd mega-link-downloader-bot ``` ```sh pip3 install -r requirements.txt ``` ```sh cp sample_config.py config.py ``` ```sh nano config.py ``` - Now you will be inside the `config.py` file. - Then edit the values in it with your values! (Inside your `config.py` file you will see the examples of how to edit the fields.) - (For pasting letters, copy any value you want and take the curser to the place you want by arrow keys and right click the mouse! 😅) - After editing all with appropriate values as mentioned in the config file press Ctrl + X from your keyboard. - Then press y in your keyboard. - Then execute the below command. 👇 ```sh python3 bot.py ``` Now If you did everything correctly, the bot will be running successfully! 🥳

Variables


Bot Commands

Normal User Commands
- `/start` - To check if the bot is alive! - `/help` - To get the detailed help guide of using the bot! - `/deletethumbnail` - To delete your saved custom thumbnail!
Admin Commands
- `/mega_ini` - If you are the bot owner (who deploys the bot) and have a pro/business account; In addition to providing your mega credentials in config variables when deploying the bot, you will have to create a mega.ini file for using with the download engine 'megatools' which is used in this repository. Going through this step is essential if you are willing to avoid quota limits when downloading links! Create a new text file in notepad or from any other method. Copy the code shown below and paste it in your newly created text file. Replace the values with your actual credentials! Then save the file as "mega.ini" ```sh [Login] Username = your-mega-email-without-inverted-commas Password = your-mega-password-without-inverted-commas [Network] # 1MiB/s SpeedLimit = 0 [UI] Colors = true ``` Note :- In the above code change only the "Username" and the "Password" with your credentials. Keep others exactly as it is and save the file as "mega.ini" Now send your "mega.ini" file to your bot and as a reply to it send the command /mega_ini
- `/black` - To ban unwanted users from the bot!
(Syntax of sending the commnad to the bot is:- /black userid)
- `/unblack` - To unban banned users from the bot!
(Syntax of sending the commnad to the bot is:- /unblack userid)
- `/lisblack` - To get the telegram id list of banned user's from the bot!
- `/broadcast` - To broadcast a message to all the users of the bot!
(Syntax of sending the commnad to the bot is:- /broadcast as a reply to the message that you want to broadcast!)
- `/stats` - To get the total number of users who has used your bot!

Reason for making this open source :-

For the help of any guy like me in this world who is wondering how to make a bot for downloading mega links, or for whoever that is finding a code to download mega links; thought to make this public. 😇❤️


Credits, and Thanks to

Project written and created by - XMYSTERIOUSX


LICENSE


Buy Me a Coffee

"Buy Me A Coffee"