Claro! Aqui está a versão do README em inglês, com a descrição especificando que é um Telegram bot:
AdsumLegal is a Telegram bot designed to help you download media content (videos and images) from popular social media platforms such as Instagram, TikTok, Reddit, and X (Twitter). Just send the link of any content, and the bot will take care of the rest: download the file and send it back to you.
- Support for Instagram, TikTok, Reddit, and X (Twitter): Send the link to any media content, and the bot will fetch and download the corresponding file for you.
- Download videos and images: The bot supports high-quality videos and images.
- Hassle-free downloads: With just a single click, the bot does all the work and sends the file back to you.
- Content descriptions: If available, the bot will also send the content description along with the media.
This project leverages the Telegram API and libraries like Instaloader and yt-dlp to download videos and images from the social platforms mentioned.
- The bot receives a message containing a media link (Instagram, TikTok, Reddit, or X).
- The bot processes the content, downloads the corresponding file, and sends the media back to the user.
- If the content has a description, it will be sent as well.
Follow the steps below to run AdsumLegal on your local machine.
git clone https://github.com/Antonioreverso/adsumlegal.git
cd adsumlegal
Create a virtual environment and install the necessary dependencies:
python3 -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt
Create a file named token.ini
in the project’s root directory with the following content:
[telegram]
token=YOUR_BOT_TOKEN_HERE
You can get the token by creating a bot via BotFather.
Once everything is configured, simply run the main.py
script:
python main.py
Now, your bot will be up and running, ready to respond to the links you send it!
This file is the entry point for the bot. It configures and starts the ApplicationBuilder from the python-telegram-bot
library, defines message handlers, and calls the run_polling()
function to start listening for new messages.
This module contains the logic for downloading the videos and images. It uses the Instaloader library to download Instagram content and yt-dlp to download videos from other platforms (such as TikTok and Reddit).
The Observer monitors incoming messages. It checks if the message contains a link to a supported platform (Instagram, TikTok, Reddit, X) and calls the VideoDownloader
to process the content.
- Receiving the link: The bot receives a message containing a link.
- Identifying the platform: The Observer checks whether the link belongs to a supported platform.
- Downloading: The VideoDownloader downloads the video/image.
- Sending media: The bot sends the file back to the user, along with the description if available.
This project is licensed under the MIT license. See the LICENSE file for more details.
Contributions are welcome! If you want to improve or add new features, feel free to open an issue or submit a pull request.
-
Instagram: Send a link to any Instagram post and the bot will return the video or image.
Example link:
https://www.instagram.com/p/xyzabc123/
-
TikTok: Send a link to any TikTok video.
Example link:
https://www.tiktok.com/@username/video/1234567890
-
Reddit: The bot can also download videos and images from Reddit posts.
Example link:
https://www.reddit.com/r/funny/comments/abc123/
-
X (Twitter): Send a link to a tweet with media, and the bot will download it.
Example link:
https://x.com/username/status/1234567890
-
What if the bot doesn’t respond?
Check if the token is correct and if the bot has been successfully started. If the issue persists, open an issue. -
Can I add more social media platforms?
Yes! The code is modular and easy to extend. Simply add the URL of other platforms in theObserver
.