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.py
in 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 with a chat username:
python3 SecPhoto.py -Sid <username>
Example:
python3 SecPhoto.py -Sid john_doe
-
Or use a numeric chat ID:
python3 SecPhoto.py -Nid <chat_id>
Example:
python3 SecPhoto.py -Nid 123456789
If you need to use a proxy:
python3 SecPhoto.py -p 127.0.0.1:9050 -Sid <username>
- Run the command with the target chat ID or username
- The tool will start monitoring the specified chat
- Go to the Telegram chat and reply to any self-destructing photo/video
- 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 |
---|---|---|
-Sid , --string-id |
Chat username | -Sid john_doe |
-Nid , --numeric-id |
Numeric chat ID | -Nid 123456789 |
-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
- ✅ 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.jpg
orsecret.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.session
file 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.