A telegram bot to download mega.nz links. (made with pyrogram).
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 @xmysteriousx as a part of @mysterious_uploader_robot
Please be kind to star and fork this repo!✨😇
Notes :-
Note :- Downloads are speed on heroku too! 😍
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!)
sudo apt update
sudo apt upgrade
apt-get update
apt-get install tmux
apt install meson
sudo apt-get install libtool libglib2.0-dev gobject-introspection libgmp3-dev nettle-dev asciidoc glib-networking openssl libcurl4-openssl-dev libssl-dev
git clone https://github.com/XMYSTERlOUSX/megatools
cd megatools
meson b
ninja -C b
sudo ninja -C b install
cd
wget https://mega.nz/linux/MEGAsync/xUbuntu_20.04/amd64/megacmd-xUbuntu_20.04_amd64.deb
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!)
tmux
Now there are two methods to go further!
Method 1
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.config.py
file you will see the examples of how to edit the fields.)git clone You_forked_repo_url
apt install python3-pip
apt install ffmpeg
cd mega-link-downloader-bot
pip3 install -r requirements.txt
python3 bot.py
Now If you did everything correctly bot will be running successfully! 🥳
Method 2
git clone https://github.com/XMYSTERlOUSX/mega-link-downloader-bot
apt install python3-pip
apt install ffmpeg
cd mega-link-downloader-bot
pip3 install -r requirements.txt
cp sample_config.py config.py
nano config.py
config.py
file.config.py
file you will see the examples of how to edit the fields.)python3 bot.py
Now If you did everything correctly, the bot will be running successfully! 🥳
API_ID
- Get this value from https://my.telegram.org/apps
API_HASH
- Get This Value from https://my.telegram.org/apps
TG_BOT_TOKEN
- Make a bot from https://t.me/BotFather and enter the token here.Mega_email
- This is not necessary! Enter your mega email only if you have a mega.nz account with pro/business features. (Used for downloading links with the download engine 'MEGAcmd' which is used in this repository.)Mega_password
- This is not necessary! Enter your mega password only if you have a mega.nz account with pro/business features. (Used for downloading links with the download engine 'MEGAcmd' which is used in this repository.)Bot_username
- Your bot's telegram username. (must enter with '@' in the front of the username.)AUTH_USERS
- Id's of the telegram users, who you want to allow for multitasking - downloading multiple links at once!OWNER_ID
- Your(owner's) telegram idREDIS_URI
- Get This Value from http://redislabs.com/try-free (If you don't know how to obtain these values a complete video tutorial is available here:- https://t.me/botzupdate/5)REDIS_PASS
- Get This Value from http://redislabs.com/try-free (If you don't know how to obtain these values a complete video tutorial is available here:- https://t.me/botzupdate/5)/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!/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"
[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!
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. 😇❤️
Project written and created by - XMYSTERIOUSX