{"id":21318039,"url":"https://github.com/eyaadh/megadlbot_oss","last_synced_at":"2025-07-13T17:08:53.256Z","repository":{"id":41207113,"uuid":"294149274","full_name":"eyaadh/megadlbot_oss","owner":"eyaadh","description":"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 until it retired.","archived":false,"fork":false,"pushed_at":"2021-06-27T07:04:23.000Z","size":180,"stargazers_count":185,"open_issues_count":1,"forks_count":165,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-07-05T03:29:02.435Z","etag":null,"topics":["aiofiles","aiohttp","bot","ffmpeg","ffprobe","google-python-api","megadlbot","megatron","mongodb","pymongo","pyrogram","seedr","telegram","tgcrypto","youtube-dl"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eyaadh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-09T15:12:19.000Z","updated_at":"2025-05-11T19:34:51.000Z","dependencies_parsed_at":"2022-07-31T11:47:59.135Z","dependency_job_id":null,"html_url":"https://github.com/eyaadh/megadlbot_oss","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eyaadh/megadlbot_oss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyaadh%2Fmegadlbot_oss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyaadh%2Fmegadlbot_oss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyaadh%2Fmegadlbot_oss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyaadh%2Fmegadlbot_oss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyaadh","download_url":"https://codeload.github.com/eyaadh/megadlbot_oss/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyaadh%2Fmegadlbot_oss/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265175567,"owners_count":23722661,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiofiles","aiohttp","bot","ffmpeg","ffprobe","google-python-api","megadlbot","megatron","mongodb","pymongo","pyrogram","seedr","telegram","tgcrypto","youtube-dl"],"created_at":"2024-11-21T19:11:02.820Z","updated_at":"2025-07-13T17:08:53.205Z","avatar_url":"https://github.com/eyaadh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Megadlbot aka Megatron:\nMegatron 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.\n\nMegatron 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. \n\n\u003e [Youtube Playlist](https://www.youtube.com/playlist?list=PLApP3aDELGhvQqPcA_DsTSt-sA0v2OkqP)\n\n## Important libraries used by the application:\n1. [aiohttp](https://docs.aiohttp.org/en/latest/client.html)\n2. [aiofiles](https://github.com/mosquito/aiofile)\n3. [pymongo](https://github.com/mongodb/mongo-python-driver)\n4. [pyrogram](https://docs.pyrogram.org/)\n5. [tgcrypto](https://docs.pyrogram.org/topics/tgcrypto)\n6. [Youtube-dl](https://github.com/ytdl-org/youtube-dl)\n7. [google-api-python-client](https://github.com/googleapis/google-api-python-client)\n\nThe application makes use of [MongoDB](https://www.mongodb.com/) for its database, also uses [ffprobe](https://ffmpeg.org/ffprobe.html) from ffmpeg for generating media info.\nAlso optionally it makes use of [seedr](https://www.seedr.cc/) 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\n\nTo 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](https://support.google.com/a/answer/7378726?hl=en) or otherwise a much in depth detailed documentation [here](https://cloud.google.com/iam/docs/creating-managing-service-account-keys). Also I have shown this process on the 18th [Video](https://youtu.be/wOrmOvRhFsk?t=469) of the YouTube Series.\n\n## Run on Docker 🐳\n```You can simply ignore everything below if you choose to go with Docker Method```\u003cbr\u003e\n- [Docker Guide](DockerReadme.md)\n\n## Cloning and running:\n1. Installation of DB\n\n---\n### Ubuntu:\n```\nsudo apt update\nsudo apt install -y mongodb\n\n# create a admin user and assign it roles\nmongo\nuse admin\ndb.createUser({user:\"admin\", pwd:\"password\", roles:[{role:\"root\", db:\"admin\"}]})\nexit\n\n# edit the YAML config file with your favorite editor to enable authentication on DB instance\nvim /etc/mongodb.conf\n\n#Add these lines at the bottom of the YAML config file:\nauth=true\n\n# now save the file and once its closed restart mongo service:\nservice mongod restart\n```\n\n### Windows:\na. Download the installer from [here](https://www.mongodb.com/try/download/community?tck=docs_server), and run it. \\\nb. Follow the MongoDB Community Edition installation wizard. \\\nc. Create a admin user and assign it roles:\n```\n# I assume you had used the default location to install.\n# To connect a mongo.exe shell to the MongoDB instance, open another Command Interpreter with Administrative privileges and run:\n\"C:\\Program Files\\MongoDB\\Server\\4.4\\bin\\mongo.exe\"\nuse admin\ndb.createUser({user:\"admin\", pwd:\"password\", roles:[{role:\"root\", db:\"admin\"}]})\nexit\n```\nd. Stop the Mongo `MongoDB Server (MongoDB)` service from services.msc. \\\ne. 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:\n```\nsecurity:\n  authorization: enabled\n```\nf. Save the file and close it, also start the `MongoDB Server (MongoDB)` service that we stopped at services.msc\n\n---\n\n\n2. Installation of ffmpeg: \\\na. Ubuntu: `apt install -y ffmpeg`. \\\nb. Windows: A full documentation of how to is [here](https://www.wikihow.com/Install-FFmpeg-on-Windows).\n\u003e Also I had shown this on my [video](https://www.youtube.com/watch?v=MMRtEvGpzdk)\n\n---\n\n3. `git clone https://github.com/eyaadh/megadlbot_oss.git`, to clone and the repository.\n4. `cd megadlbot_oss/`, to enter the directory.\n5. `pip3 install -r requirements.txt`, to install python libraries/dependencies/requirements for the project.\n\n----\n6. Create a new `config.ini` using the sample available at `mega/working_dir/config.ini.sample` at `mega/working_dir/`.\n```\n# Here is a sample of config file and what it should include:\n[pyrogram]\n# More info on API_ID and API_HASH can be found here: https://docs.pyrogram.org/intro/setup#api-keys\napi_id = \napi_hash = \n\n[plugins]\nroot = mega/telegram/plugins\n\n[bot-configuration]\n# More info on Bot API Key/token can be found here: https://core.telegram.org/bots#6-botfather\napi_key = \nsession = megadlbot\n# Watch this video to understand what the dustbin is: https://www.youtube.com/watch?v=vgzMacnI5Z8\ndustbin = \nallowed_users = [123123123, 321321321]\n# a list of user ids who are allowed to use this bot\n\n[database]\n# In this section db_host is the address of the machine where the MongoDB is running, if you are running \n# both the bot and Mongo on same machine leave it as local host.\n# db_username and db_password are the username and password we assigned roleas with at the first step \n# while we installed Database\ndb_host = localhost\ndb_username = admin\ndb_password = \ndb_name = megadlbot\n\n# 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.\n[web_server]\nbind_address = 0.0.0.0\nfqdn = localhost\nport = 8080\n```\n\n---\n\n7.  Run with `python3.9 -m mega`, stop with \u003ckbd\u003eCTRL\u003c/kbd\u003e+\u003ckbd\u003eC\u003c/kbd\u003e.\n\u003e It is recommended to use [virtual environments](https://docs.python-guide.org/dev/virtualenvs/) 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.\n\n\n### Deploying on Heroku:\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\nBefore clicking the Deploy button make sure you have the following details with you too:\n1. 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).\n2. Create a Telegram channel (This one for the dustbin. As mentioned above watch this [video](https://www.youtube.com/watch?v=vgzMacnI5Z8) to understand what the dustbin is.) \n3. Well as obvious as it can be create a bot with @BotFather, also get your API ID and API Hash from my.telegram.org.  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyaadh%2Fmegadlbot_oss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyaadh%2Fmegadlbot_oss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyaadh%2Fmegadlbot_oss/lists"}