Telegram Scraper v1.6 Get Access to ALL FILES
A powerful, multi-account Telegram group member scraper and adder with encrypted session storage, automatic account rotation, and a rich terminal UI.
- Multi-Account Support — Log in multiple Telegram accounts and rotate between them automatically
- 3 Login Methods — Phone number (OTP + 2FA), QR code scan, or Telegram Desktop TData import
- 2 Scraping Modes — Scrape from the visible members list, or extract hidden members from message history
- 2 Adding Modes — Rush Adder (tracks progress by removing added members from CSV) or Calm Adder (keeps CSV intact)
- Message Broadcast — Send a formatted DM to all scraped members from a Markdown file, with 30–60s delays and account rotation
- Session Encryption — All session strings encrypted with Fernet (AES-128) using PBKDF2 key derivation
- FloodWait Handling — Automatic wait with jitter for small delays; switches account on large delays (1hr+)
- Checkpoint Resume — Interrupted hidden-member scrapes can be resumed from where they left off
- Account Cooldown Tracking — Persistent cooldown tracking across sessions with automatic expiry
- Rich Terminal UI — Progress bars, spinners, styled tables, and color-coded output
- Session Management — List all sessions, test connectivity, and clean up inactive accounts
- Structured Logging — Rotating file logs (never logs sensitive data like session strings)
- Atomic CSV Writes — Data written to temp file first, then replaced — no corruption on crash
- Python 3.8+
- Git (required to install the Pyrogram fork)
- Telegram API Credentials (API_ID and API_HASH)
If you have repo access:
git clone <repository-url>
cd TelegramScraperIf you received a ZIP:
Extract the ZIP to a folder and open a terminal there.
pip install -r requirements.txtNote: TgCrypto is mandatory. Without it, Pyrogram falls back to a pure-Python AES implementation that is extremely slow and will lock up scraping tasks. The app will refuse to start if TgCrypto is not installed.
If TgCrypto fails to install, make sure you have a C compiler available:
- Windows: Install Visual C++ Build Tools
- Linux/Termux:
sudo apt install build-essential(orpkg install build-essentialon Termux) - macOS:
xcode-select --install
- Visit https://my.telegram.org/apps
- Log in with your Telegram phone number
- Click "Create New Application"
- Fill in the app name (e.g., "MyApp") and any other required fields
- Copy your API_ID (a number) and API_HASH (a string)
Create a file named .env in the project root:
API_ID=12345678
API_HASH=your_api_hash_hereReplace the values with your actual credentials from step 3.
python main.pyWhen you launch the tool, you'll see the main menu:
TelegramScraper v1.6
ℹ 0 sessions loaded (check Manage Sessions for status)
┌─────────────────────┐
│ Main Menu │
├─────────────────────┤
│ 01 Login Telegram Account
│ 02 Members Scraper
│ 03 Members Adder
│ 04 Message Broadcast
│ 05 Manage Sessions
│
│ 99 About
│ 00 Exit
└─────────────────────┘
› Choose an option:
Typical workflow:
- Login one or more Telegram accounts (Option 01)
- Scrape members from a source group (Option 02)
- Add scraped members to a target group (Option 03)
- Broadcast a message to all scraped members (Option 04)
This option lets you authenticate Telegram accounts. Sessions are encrypted and stored locally in the sessions/ directory.
On your first login, you'll be asked to create an encryption password (minimum 4 characters). This password protects all your stored session strings using Fernet encryption with PBKDF2 key derivation (480,000 iterations). On subsequent logins, you'll enter this same password to decrypt existing sessions and encrypt new ones.
Important: If you forget your encryption password, stored sessions cannot be recovered. You'll need to log in again.
01 - Login with Phone Number
02 - Login from TData
03 - Login with QR Code
00 - Go Back
- Enter your phone number in international format (e.g.,
+1234567890) - Telegram sends an OTP code to your phone/app
- Enter the OTP code (spaces are automatically stripped)
- If your account has 2FA enabled, enter your 2FA password (input is masked)
- Session is encrypted and saved
- A QR code is displayed in your terminal
- Open Telegram on your phone → Settings → Devices → Scan QR Code
- The tool automatically detects the scan (polls every 5 seconds)
- If 2FA is enabled, enter your password
- Session is encrypted and saved
- Provide the path to your Telegram Desktop
tdatafolder- Windows:
%APPDATA%\Telegram Desktop\tdata - Linux:
~/.local/share/TelegramDesktop/tdata - macOS:
~/Library/Application Support/Telegram Desktop/tdata
- Windows:
- The tool extracts the auth key and converts it to a Pyrogram session
- Connectivity is verified by calling
get_me() - Session is encrypted and saved
Scrape members from a Telegram group and save them to members.csv.
01 - Scrape Non-Hidden Members (from Group's Members List)
02 - Scrape Hidden Members (from Group's Messages/Mentions)
00 - Go Back
Scrape Hidden Members
Scrapes members from message history and mentions — useful when the members list is restricted.
- Enter the group link or username
- The tool iterates through all messages in the group, extracting users from:
- Message authors
@usernamementions- Text mentions (clickable names that link to profiles)
- A checkpoint is saved every 50 unique members to
scrape_checkpoint.json - If interrupted (Ctrl+C), progress is saved — next time you scrape the same group, you'll be asked to resume from the checkpoint
- Results saved to
members.csv
Best for: Private groups with hidden member lists, or when you want to capture active participants.
Scrape Non-Hidden Members
Scrapes from the group's official members list (visible when you tap "Members" in group info).
- Enter the group link or username (e.g.,
https://t.me/mygroup,@mygroup, ormygroup) - The tool selects an available account (skips accounts on cooldown)
- Iterates through the members list, filtering out bots and deduplicating by user ID
- A spinner shows real-time progress: member count, group name, and which account is being used
- Results saved to
members.csv
Best for: Public groups or groups where the members list is visible.
Name,ID,Username,Access Hash,Group Name,Group ID
John Doe,123456789,johndoe,1234567890123456,MyGroup,-100987654321
Jane,987654321,,9876543210987654,MyGroup,-100987654321Add scraped members from members.csv to a target group.
01 - Rush Adder (Remove user from 'members.csv' after adding)
02 - Calm Adder (Keep user in 'members.csv' after adding)
00 - Go Back
| Rush Adder | Calm Adder | |
|---|---|---|
| After adding a member | Removes them from members.csv |
Keeps members.csv unchanged |
| Best for | Production runs — tracks progress, no duplicate adds on restart | Testing or intentional re-adds |
- Enter the target group link or username
- A progress bar appears showing: percentage, added count, skipped count, elapsed time, and ETA
- For each member in
members.csv:- Attempts to add them to the group
- On success: waits a random 3–8 seconds before the next add (jitter to avoid detection)
- If already a member: skips (no delay)
- If privacy-restricted, kicked, or invalid: skips with reason logged
- Completion summary shows total processed, added, skipped, and remaining
- Small FloodWait (< 1 hour): Waits in place with added jitter, then retries with the same account
- Large FloodWait (>= 1 hour): Puts the account on cooldown and switches to the next available account
- PeerFlood (spam flag): Automatically tries a workaround (add as contact → add to group → remove contact)
If you have multiple accounts logged in, the adder cycles through them automatically. When one account hits a large FloodWait, it moves to the next. Cooldown times are persisted in account_cooldowns.json so they survive restarts.
Send a formatted direct message to all scraped members in members.csv.
- On first use, a sample template file (
message_template.md) is created in the project root — you can edit it or use your own.mdfile - A syntax guide is displayed showing supported Markdown formatting and how it renders on Telegram
- Enter the path to your
.mdmessage file - The message is converted to Telegram-compatible HTML and a preview is shown for confirmation
- After confirming, messages are sent one-by-one to each user in
members.csv - Each successfully messaged user is removed from
members.csv(allows resuming on restart)
| Markdown | Telegram Result |
|---|---|
**bold** |
bold |
*italic* |
italic |
~~strikethrough~~ |
|
[link text](url) |
Clickable link |
`inline code` |
monospace |
```code block``` |
Code block |
# Header |
Bold header line |
- list item |
Bullet point |
Note: The maximum message length is 4096 characters (after HTML conversion). Messages exceeding this limit will be rejected before sending.
- 30–60 seconds random delay between each message (mimics human behavior)
- Small FloodWait (< 1 hour): Waits with jitter, then retries
- Large FloodWait (>= 1 hour): Switches to the next available account
- Account cooldowns are persisted in
account_cooldowns.json
| Scenario | Action |
|---|---|
| User blocked the account | Skipped, removed from CSV |
| User account deactivated | Skipped, removed from CSV |
| User not found (invalid ID/username) | Skipped, removed from CSV |
| User has privacy restrictions | Skipped, kept in CSV (may change later) |
| Sending account deactivated/banned | Marked inactive, switches to next account |
| Ctrl+C interrupted | Stops gracefully, CSV reflects partial progress |
View, test, and clean up your stored Telegram sessions.
01 - List All Sessions
02 - Test All Sessions
03 - Remove Inactive Sessions
00 - Go Back
Displays a table of all stored sessions:
┌───┬─────────────────┬──────────┬───────────┐
│ # │ Phone │ Status │ Encrypted │
├───┼─────────────────┼──────────┼───────────┤
│ 1 │ +1234***890 │ Active │ Yes │
│ 2 │ +9876***321 │ Cooldown │ Yes │
└───┴─────────────────┴──────────┴───────────┘
- Phone numbers are masked for security
- Status shows Active, Cooldown (with remaining time), or error reason
- Encrypted column shows whether the session string is Fernet-encrypted
Connects each session to Telegram and verifies it's still valid:
- Enter your encryption password (to decrypt sessions)
- Each session is tested by calling
get_me() - Results shown in a table: OK (with user ID) or FAILED (with error reason)
Finds sessions with a non-Active status (banned, deactivated, auth key invalid, etc.) and offers to delete them:
- Shows a table of inactive sessions with their status
- Asks for confirmation:
Remove all inactive sessions? (y/n) - On confirm: deletes the session CSV files from disk
Displays tool information: name, version, developer, and contact details.
TelegramScraper/
├── main.py # Entry point, main menu loop
├── configs.py # Config class, loads .env variables
├── crypto.py # Fernet encryption/decryption for sessions
├── account_manager.py # Multi-account rotation & cooldown tracking
├── retry.py # @async_retry decorator with exponential backoff
├── logger.py # Rotating file logger setup
├── utils.py # CSV I/O, input helpers, phone validation
├── requirements.txt # Pinned dependencies
├── .env # Your API credentials (not in repo)
├── LICENSE # License & Terms of Service
│
├── funcs/
│ ├── ui.py # Rich console styling, prompts, spinners
│ ├── helpers.py # Session loading, member saving helpers
│ └── options_handlers/
│ ├── login.py # Phone, QR, TData login flows
│ ├── scrape_members.py# Non-hidden & hidden member scraping
│ ├── add_members.py # Rush & calm member adding
│ ├── broadcast_message.py # Message broadcast to scraped members
│ ├── manage_sessions.py # List, test, cleanup sessions
│ └── about.py # About screen
│
├── sessions/ # Encrypted session CSVs (not in repo)
├── logs/ # Rotating log files (not in repo)
├── members.csv # Scraped member data (not in repo)
└── scrape_checkpoint.json # Resume checkpoint (not in repo)
- Session Encryption: All Telegram session strings are encrypted using Fernet (AES-128-CBC + HMAC-SHA256). The encryption key is derived from your password using PBKDF2 with 480,000 iterations and a random 16-byte salt.
- Local Storage Only: All data (sessions, member lists, logs) is stored locally on your machine. The tool does not send data to any external server.
- Phone Masking: Phone numbers are always displayed masked in the UI and logs (e.g.,
+1234***890). - Credential Safety: API credentials are loaded from
.envwhich is excluded from version control via.gitignore. - No Session Logging: Session strings are never written to log files.
TgCrypto is a C extension that requires a compiler:
- Windows: Install Visual C++ Build Tools, then retry
pip install TgCrypto - Linux: Run
sudo apt install build-essential python3-dev, then retry - Termux: Run
pkg install build-essential, then retry - macOS: Run
xcode-select --install, then retry
You're missing the .env file or it has incorrect values:
- Create a
.envfile in the project root - Add your credentials:
API_ID=12345678andAPI_HASH=your_hash - Make sure there are no spaces around the
=sign
These are Telegram rate limits, not bugs:
- FloodWait: Telegram is asking you to slow down. The tool handles this automatically — small waits are waited out, large waits trigger account switching.
- PeerFlood: Your account has been flagged for adding too many users. Switch to a different account or wait a few hours/days.
If you see decryption errors when testing sessions:
- Make sure you're entering the correct encryption password
- If you've forgotten your password, delete the affected session files from
sessions/and log in again
- Non-hidden scraping only works if the group's members list is visible. Some groups restrict this.
- Hidden scraping extracts members from messages, so inactive members who never post or get mentioned won't be found.
- Bots are automatically filtered out from results.
Can I run multiple instances at the same time? No. Session files and CSV data are shared, so running multiple instances can cause conflicts and data corruption.
Is my session safe? Yes. Session strings are encrypted with Fernet using a password-derived key (PBKDF2, 480k iterations). Without your password, the encrypted session is unreadable.
What if I forget my encryption password?
Stored sessions cannot be recovered. You'll need to delete the sessions/ directory and log in to your accounts again.
Why does scraping miss some members? Non-hidden scraping only sees members in the public list. For groups that hide their member list, use the hidden scraping option which extracts members from message history. Members who never posted or were mentioned won't be captured by either method.
How many accounts do I need? Minimum 1. However, having multiple accounts helps with FloodWait rotation — when one account gets rate-limited, the tool automatically switches to the next available one.
Does this work on mobile (Termux)? Yes. The tool runs on any platform with Python 3.8+: Windows, macOS, Linux, and Termux (Android). All dependencies are cross-platform.
What happens if I interrupt a scrape with Ctrl+C? For hidden member scraping, progress is automatically saved to a checkpoint file. Next time you scrape the same group, you'll be offered to resume. For non-hidden scraping, members collected so far are still saved.
| Price | 80 USD |
| Purchase & Support | Contact on Telegram |
You will get full Python source code access for lifetime & future updates.
Abir Hasan
- GitHub: github.com/AbirHasan2005
- Telegram: t.me/AbirHasan2005