A Python tool to save Telegram self-destructing photos and videos. This tool allows you to capture and save disappearing media from Telegram chats before they expire.
Before using this tool, you MUST obtain your own Telegram API credentials. The current code contains hardcoded API credentials which should be replaced with your own for security and functionality reasons.
- Python 3.6 or higher
- A Telegram account
- Telegram API credentials (api_id and api_hash)
- Go to my.telegram.org
- Log in with your phone number (the same number you use for Telegram)
- Click on "API Development Tools"
- Fill out the form with the following information:
- App title: Choose any name (e.g., "SecPhoto Tool")
- Short name: Choose a short name (e.g., "secphoto")
- URL: Leave empty or add your website
- Platform: Choose "Desktop"
- Description: Brief description of your app
- Click "Create application"
After creating the application, you'll see:
- api_id: A numeric ID (e.g., 1234567)
- api_hash: A 32-character hash (e.g., "abcdef1234567890abcdef1234567890")
- Open
SecPhoto.pyin a text editor - Find these lines (around line 11-12):
api_id = 1234567 api_hash = "82bd7b4562teujin24d18rfayt39b2d9352"
- Replace them with your own credentials:
api_id = YOUR_API_ID_HERE api_hash = "YOUR_API_HASH_HERE"
-
Clone the repository:
git clone https://github.com/Mr3rf1/SecPhoto cd SecPhoto -
Install Python dependencies:
pip install -r requirements.txt
Or if you're using Python 3 specifically:
python3 -m pip install -r requirements.txt
-
Update packages:
apt update && apt upgrade -
Install required packages:
pkg install python3 python3-pip git
-
Clone and setup:
git clone https://github.com/Mr3rf1/SecPhoto cd SecPhoto python3 -m pip install -r requirements.txt
- Start the tool simply
python3 SecPhoto.py
The tool now supports a convenient reply-to-save feature:
- Automatic Detection: The tool automatically monitors all chats and saves self-destructing media as soon as it appears
- Reply Method: If you missed a self-destructing message, simply reply to it and the tool will save the media
- Works Everywhere: This feature works in all types of chats (private, groups, channels)
- Real-time Processing: Both automatic detection and reply-based saving happen in real-time
If you need to use a proxy:
python3 SecPhoto.py -p 127.0.0.1:9050- Run the command to start monitoring all chats
- The tool will automatically detect and save self-destructing media in real-time
- New Feature: You can also save self-destructing media by replying to any message containing such media
- The tool will automatically download and save the media
- The saved media will be sent to your "Saved Messages" in Telegram
To see all available options:
python3 SecPhoto.py --help| Option | Description | Example |
|---|---|---|
-p, --proxy |
SOCKS5 proxy (IP:PORT) | -p 127.0.0.1:9050 |
--help |
Show help message | --help |
telethon- Telegram client librarycolorama- Colored terminal outputpysocks- SOCKS proxy support
- ✅ Save self-destructing photos
- ✅ Save self-destructing videos
- ✅ Reply-to-save feature - Reply to any message to save its self-destructing media
- ✅ Real-time monitoring of all chats
- ✅ SOCKS5 proxy support
- ✅ Works with both usernames and numeric IDs
- ✅ Automatic delivery to Saved Messages
- ✅ Cross-platform compatibility
- Keep your API credentials private and never share them
- The tool creates a session file (
secret.session) - keep this secure - Downloaded media is temporarily saved as
secret.jpgorsecret.mp4
Make sure you've installed all requirements:
pip install -r requirements.txt- Verify your API credentials are correct
- Make sure you're using your own api_id and api_hash
- Delete the
secret.sessionfile and try again
Make sure the script has write permissions in the current directory.
This project is for educational purposes. Please respect Telegram's Terms of Service and use responsibly.