This Python script is designed to download media files from your Telegram account and send them to your own account. It utilizes the Telethon library, which provides easy-to-use methods for interacting with the Telegram API.
Before running the script, you need to set up your Telegram API credentials and specify your phone number in a .env
file in the root directory of the script. Follow these steps:
- Go to https://my.telegram.org/auth and log in with your Telegram account.
- Copy the
api_id
andapi_hash
provided after logging in. - Create a
.env
file in the root directory of the script. - Paste the
api_id
andapi_hash
into the.env
file. - Also, include your phone number in the
.env
file.
- Run the script using Python.
- The script will prompt you to log in to your Telegram account. Follow the instructions.
- Once logged in, the script will start downloading media files from your chats.
- It will only download files that have a set TTL (Time To Live), ensuring you don't download files that are no longer available.
- Downloaded files will be sent to your own account.
- The script will continuously run, checking for new media files to download.
You can install them using pip
:
pip install -r requirements.txt
If you need to use a proxy to connect to Telegram, you can specify the proxy details in the proxy
dictionary within the script. Modify the proxy_type
, addr
, and port
fields according to your proxy settings.
The script is designed to run continuously and handle exceptions gracefully. If any errors occur during execution, they will be caught and the script will continue running.
- This script is intended for educational purposes and personal use only. Respect the privacy and rights of others when using it.
- Be cautious while downloading media files, as they may contain sensitive or copyrighted content.
By using this script, you agree to abide by Telegram's terms of service and community guidelines.
Enjoy downloading your Telegram media effortlessly! 🚀