This script automatically saves timed (self-destructing) photos and other media from Telegram chats before they disappear. It uses the Telethon library to interact with the Telegram API and download media files, saving them locally and optionally forwarding them to your Saved Messages in Telegram.
- Downloads timed/self-destructing media in Telegram chats.
- Saves downloaded media to the
downloads/
folder. - Automatically forwards the downloaded files to the user's Saved Messages.
- Handles both document-based media and regular media.
- Simple command to trigger the download by replying to a message with
.saveit
.
Before running the script, ensure you have the following installed:
- Python 3.9+
- Required Python packages:
telethon
(for interacting with Telegram API)
- FFmpeg and Mediainfo (for media processing, installed automatically if missing)
You can install the necessary Python packages by running:
pip install telethon
-
Clone the repository:
git clone https://github.com/DevURANIUM/Saveit.git cd Saveit
-
Get your Telegram API credentials:
- Go to my.telegram.org and log in.
- Navigate to "API development tools."
- Note your
api_id
andapi_hash
.
-
Configure API credentials:
- Open the script and replace the following placeholders with your API credentials:
api_id = 'your_api_id' api_hash = 'your_api_hash'
- Open the script and replace the following placeholders with your API credentials:
-
Install necessary dependencies:
- The script will automatically check for and install the
ffmpeg
andmediainfo
tools if they are not already installed.
- The script will automatically check for and install the
-
Run the script: You can start the script by running:
python3 Saveit.py
-
Trigger media download:
- To download a photo or document, reply to a message containing the media in any chat and send
.saveit
. - The media will be saved to the
downloads/
folder on your local system and automatically forwarded to your Saved Messages in Telegram.
- To download a photo or document, reply to a message containing the media in any chat and send
-
Run the script:
python3 Saveit.py
-
In a Telegram chat, reply to a media message with
.saveit
to save it locally and forward it to your Saved Messages.
- Client Setup: Initializes the Telegram client using the provided API credentials.
- Command Listener: Listens for
.saveit
commands in Telegram chats, triggered by replying to messages. - Media Handling: Downloads media files to the local system (
downloads/
folder) and forwards them to the Saved Messages chat. - Dependency Checker: Ensures that required media tools (
ffmpeg
andmediainfo
) are installed and installs them if not present.
- Telethon - Python library to interact with Telegram's API.
- FFmpeg - A complete solution to record, convert and stream audio and video.
- Mediainfo - A library used to retrieve technical information about media files.
To install FFmpeg and Mediainfo on your system (if not already installed), the script uses the following commands:
sudo apt install ffmpeg -y
sudo apt install mediainfo -y
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have suggestions for improvement, please reach out via:
Support the project through donations:
- BTC:
bc1qcclcp574hnznm0nmdzzf0ta7366svjskttqks3
- TRON:
TXJqhhwvkrTdnf5HReZf55hEzZuxjto3R4
- USDT-(TRC20):
TXJqhhwvkrTdnf5HReZf55hEzZuxjto3R4
- TON:
UQAJH2N0pqpvC9YN841w5NH1dCN9Lakwkpjvoy7vXf-vfqgv