All Projects → eyaadh → megadlbot_oss

eyaadh / megadlbot_oss

Licence: other
Megatron was a telegram file management bot that helped a lot of users, specially movie channel managers to upload their files to telegram by just providing a link to it. The project initially started as roanuedhuru_bot which lately retired and came back as Megatron which was a side project of the famous Maldivian Telegram community - @baivaru u…

Programming Languages

python
139335 projects - #7 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to megadlbot oss

TG-FileStreamBot
Stream Telegram files to web
Stars: ✭ 193 (+27.81%)
Mutual labels:  aiohttp, pyrogram, tgcrypto
Pyro-FileStreamBot
Stream Telegram files to web
Stars: ✭ 38 (-74.83%)
Mutual labels:  aiohttp, pyrogram
tgmusicbot
Telegram bot for downloading audio from YouTube, SoundCloud & MixCloud.
Stars: ✭ 66 (-56.29%)
Mutual labels:  youtube-dl, pyrogram
slam-mirrorbot
Aria/qBittorrent Telegram mirror/leech bot.
Stars: ✭ 1,072 (+609.93%)
Mutual labels:  youtube-dl, pyrogram
YouTube-Thumbnail-Downloader
A youtube videos thumbnail downloader telegram bot.
Stars: ✭ 41 (-72.85%)
Mutual labels:  pyrogram
go-ffprobe
Library to easily get the ffprobe output of a given file
Stars: ✭ 114 (-24.5%)
Mutual labels:  ffprobe
Fire-X
Powerful Telegram Maintained UserBot in Telethon
Stars: ✭ 22 (-85.43%)
Mutual labels:  pyrogram
Movie-Info-Bot
A movie information finder telegram bot
Stars: ✭ 27 (-82.12%)
Mutual labels:  pyrogram
mmdl
MMDL (Mega Music Downloader) - A tool to easily download music.
Stars: ✭ 29 (-80.79%)
Mutual labels:  youtube-dl
Pyaiodl
A python Asynchronous Downloader - Pyaiodl
Stars: ✭ 40 (-73.51%)
Mutual labels:  aiohttp
aiohttp-three-template
Project template for Python aiohttp three-tier web applications
Stars: ✭ 20 (-86.75%)
Mutual labels:  aiohttp
sync-dl
Flexible tool for saving and syncing playlists from YouTube without loosing removed songs
Stars: ✭ 13 (-91.39%)
Mutual labels:  youtube-dl
wybm
✂️ Extract and cut youtube webms
Stars: ✭ 55 (-63.58%)
Mutual labels:  youtube-dl
Tieba-Birthday-Spider
百度贴吧生日爬虫,可抓取贴吧内吧友生日,并且在对应日期自动发送祝福
Stars: ✭ 28 (-81.46%)
Mutual labels:  pymongo
yutto
🧊 一个可爱且任性的 B 站视频下载器(bilili V2)
Stars: ✭ 383 (+153.64%)
Mutual labels:  aiohttp
youtube-dl-docker
Download with youtube-dl using command line arguments or a configuration file + Automated updates
Stars: ✭ 44 (-70.86%)
Mutual labels:  youtube-dl
scp-079-captcha
Provide challenges for newly joined members
Stars: ✭ 52 (-65.56%)
Mutual labels:  pyrogram
trellio
Python3 asyncio based microframework for microservice architecture
Stars: ✭ 19 (-87.42%)
Mutual labels:  aiohttp
YT-DLP-SCRIPTS
...Just a place for me to share my various YT-DLP & related bash scripts.
Stars: ✭ 70 (-53.64%)
Mutual labels:  youtube-dl
aioScrapy
基于asyncio与aiohttp的异步协程爬虫框架 欢迎Star
Stars: ✭ 34 (-77.48%)
Mutual labels:  aiohttp

Megadlbot aka Megatron:

Megatron was a telegram file management bot that helped a lot of users, it specifically helped movie channel managers to upload their files to telegram by just providing a link to it. The project initially started as roanuedhuru_bot which lately retired and came back as Megatron which was a side project of the famous Maldivian Telegram community - @Baivaru, until it retired.

Megatron is a project that is very close to my heart, me being the sole brains who developed it since the very beginning, and as you are aware, for the course of its life span the bot was never opensource unlike many other telegram bots which did a similar job. Many users beseeched to make it opensource so after I decided to kill the project I decided not just to make the source code public but to instead build the whole thing from scratch and upload it on YouTube. The purpose of this was to ensure that anyone could create their own bot based on this with ease and to ensure that the code was beautiful and easy to read.

Youtube Playlist

Important libraries used by the application:

  1. aiohttp
  2. aiofiles
  3. pymongo
  4. pyrogram
  5. tgcrypto
  6. Youtube-dl
  7. google-api-python-client

The application makes use of MongoDB for its database, also uses ffprobe from ffmpeg for generating media info. Also optionally it makes use of seedr API to allow download torrents via the bot - however this is a user base setting, that end user needs to setup via options under /dldsettings

To make use of google API to generate google drive links for the files that you upload, you would be required to create a service account and share its key with the bot from the available options at /dldsettings, to generate this key make use of this step by step documentation or otherwise a much in depth detailed documentation here. Also I have shown this process on the 18th Video of the YouTube Series.

Run on Docker 🐳

You can simply ignore everything below if you choose to go with Docker Method

Cloning and running:

  1. Installation of DB

Ubuntu:

sudo apt update
sudo apt install -y mongodb

# create a admin user and assign it roles
mongo
use admin
db.createUser({user:"admin", pwd:"password", roles:[{role:"root", db:"admin"}]})
exit

# edit the YAML config file with your favorite editor to enable authentication on DB instance
vim /etc/mongodb.conf

#Add these lines at the bottom of the YAML config file:
auth=true

# now save the file and once its closed restart mongo service:
service mongod restart

Windows:

a. Download the installer from here, and run it.
b. Follow the MongoDB Community Edition installation wizard.
c. Create a admin user and assign it roles:

# I assume you had used the default location to install.
# To connect a mongo.exe shell to the MongoDB instance, open another Command Interpreter with Administrative privileges and run:
"C:\Program Files\MongoDB\Server\4.4\bin\mongo.exe"
use admin
db.createUser({user:"admin", pwd:"password", roles:[{role:"root", db:"admin"}]})
exit

d. Stop the Mongo MongoDB Server (MongoDB) service from services.msc.
e. Edit the Yamal Config file - mongodb.cfg located at C:\Program Files\MongoDB\Server\4.4\bin with your favorite editor and add the following lines:

security:
  authorization: enabled

f. Save the file and close it, also start the MongoDB Server (MongoDB) service that we stopped at services.msc


  1. Installation of ffmpeg:
    a. Ubuntu: apt install -y ffmpeg.
    b. Windows: A full documentation of how to is here.

Also I had shown this on my video


  1. git clone https://github.com/eyaadh/megadlbot_oss.git, to clone and the repository.
  2. cd megadlbot_oss/, to enter the directory.
  3. pip3 install -r requirements.txt, to install python libraries/dependencies/requirements for the project.

  1. Create a new config.ini using the sample available at mega/working_dir/config.ini.sample at mega/working_dir/.
# Here is a sample of config file and what it should include:
[pyrogram]
# More info on API_ID and API_HASH can be found here: https://docs.pyrogram.org/intro/setup#api-keys
api_id = 
api_hash = 

[plugins]
root = mega/telegram/plugins

[bot-configuration]
# More info on Bot API Key/token can be found here: https://core.telegram.org/bots#6-botfather
api_key = 
session = megadlbot
# Watch this video to understand what the dustbin is: https://www.youtube.com/watch?v=vgzMacnI5Z8
dustbin = 
allowed_users = [123123123, 321321321]
# a list of user ids who are allowed to use this bot

[database]
# In this section db_host is the address of the machine where the MongoDB is running, if you are running 
# both the bot and Mongo on same machine leave it as local host.
# db_username and db_password are the username and password we assigned roleas with at the first step 
# while we installed Database
db_host = localhost
db_username = admin
db_password = 
db_name = megadlbot

# for the following section fill in the FQDN with which end users can reach the host machine, bindaddress is the address of the adapter to bind with while running webserver and the port for the webserver to listen.
[web_server]
bind_address = 0.0.0.0
fqdn = localhost
port = 8080

  1. Run with python3.9 -m mega, stop with CTRL+C.

It is recommended to use virtual environments while running the app, this is a good practice you can use at any of your python projects as virtualenv creates an isolated Python environment which is specific to your project.

Deploying on Heroku:

Deploy

Before clicking the Deploy button make sure you have the following details with you too:

  1. Create a free account on cloud.mongodb.com (This is for the DB and you need its details for the config file as explained above, also keep a note that if you host mongoDB community edition on your own its totally free otherwise you might have limitations).
  2. Create a Telegram channel (This one for the dustbin. As mentioned above watch this video to understand what the dustbin is.)
  3. Well as obvious as it can be create a bot with @BotFather, also get your API ID and API Hash from my.telegram.org.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].