Troubleshooting
Solutions to common issues and error messages.
Installation Issues
pip install fails
Symptom:
Solutions:
-
Update pip:
-
Check Python version:
-
Try with python3:
Import errors on Ubuntu/Debian
Symptom:
Solution:
Update cryptography:
Or reinstall tgdl:
Permission denied
Symptom:
Solution:
Install in user directory:
Or use virtual environment (recommended):
python -m venv venv
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # Windows
pip install tgdl
Authentication Issues
Invalid phone number
Symptom:
Solutions:
-
Include country code:
-
No spaces or dashes:
-
Verify number is registered:
- Check you can login to Telegram app with this number
Verification code issues
Symptom:
Solutions:
- Check for typos:
- Code is usually 5 digits
-
No spaces
-
Don't wait too long:
- Code expires after ~10 minutes
-
Request new code if expired
-
Check Telegram app:
- Code appears in Telegram app (Telegram service message)
-
Not SMS (usually)
-
Try SMS code:
- Wait for SMS if app code doesn't work
- Check spam folder
Two-factor authentication error
Symptom:
Solution:
-
tgdl will prompt for 2FA password:
-
If you forgot password:
- Reset via Telegram app
- Settings → Privacy and Security → Two-Step Verification
-
Reset password (requires recovery email)
-
If you don't have 2FA:
- This error shouldn't appear
- May indicate account security issue
Session expired
Symptom:
Solutions:
-
Logout and login again:
-
Remove session manually:
Then login again:
- Check API credentials:
- Verify API ID and Hash are correct
Could not find input entity
Symptom:
Solutions:
-
For channels/groups - verify you're a member:
-
Join the channel:
- Open Telegram app
- Join the channel/group
- Wait a few seconds
-
Try download again
-
Use correct entity ID:
- From
tgdl channelsoutput -
Not from web URL (use different format)
-
For private channels:
Download Issues
No files downloaded
Symptom:
Possible Causes & Solutions:
- Channel has no media:
-
If still zero, channel may only have text
-
Filters too restrictive:
-
All files already downloaded:
-
This is normal (no new content)
-
Wrong entity type:
-
Message ID range issue:
Download interrupted
Symptom:
What happens:
tgdl saves progress automatically. When you run the command again: - ✅ Skips already downloaded files - ✅ Resumes partial downloads from where they stopped - ✅ Only downloads new/missing files - ✅ No re-downloading necessary
Example:
# Start download
$ tgdl download -c 1234567890
Downloading 100 files...
Downloaded 25 files...
^C
⚠ Download cancelled by user.
# Wait 1 hour...
# Run same command - tgdl remembers progress
$ tgdl download -c 1234567890
Using 25 already downloaded files
Resuming from file 26...
Downloading from file 26 of 100...
Downloaded 75 more files...
Files saved:
- .tgdl_partial files: Incomplete downloads (auto-detected and resumed)
- Completed files: Marked as complete and skipped
Just run the same command again - no need for special flags or recovery procedures!
Slow download speed
Possible Causes & Solutions:
- Network speed limitation:
- Check internet speed
-
Large files take time
-
Too many concurrent downloads:
-
Telegram server limitations:
- Normal during peak hours
-
Try different time of day
-
Large file sizes:
Connection timeout
Symptom:
Automatic handling in v1.2.0+:
tgdl automatically retries transient network errors! When a timeout occurs: - Automatically retries up to 3 times - Uses exponential backoff (2s, 4s, 8s waits) - Continues to next file if all retries fail - Downloads continue automatically
What you'll see:
Downloading file1.jpg...
⚠ Download failed, retrying... (Attempt 1/3)
Waiting 2 seconds...
✓ Downloaded file1.jpg (succeeded on retry)
Downloading file2.jpg...
⚠ Download failed, retrying... (Attempt 1/3)
⚠ Download failed, retrying... (Attempt 2/3)
Waiting 4 seconds...
✓ Downloaded file2.jpg (succeeded on 2nd retry)
If all retries fail: - File is skipped - Download continues with next file - Failed files can be retried later by running command again
Manual solutions (if auto-retry insufficient):
-
Check internet connection:
-
Retry the download:
- Auto-retries failed files
-
Already downloaded files skipped
-
Reduce concurrent downloads:
-
Check firewall/proxy:
- Telegram may be blocked
- Try VPN if in restricted region
Rate Limited by Telegram (FloodWaitError)
What happens: tgdl automatically handles rate limiting for you! When Telegram limits requests, tgdl will: - Detect the rate limit - Show a countdown timer - Automatically wait - Resume downloading
Example output:
⏳ Rate limited by Telegram. Auto-waiting 45s...
Resuming in 45s...
Resuming in 44s...
Resuming in 43s...
...
Resuming in 1s...
Resuming now...
What you need to do: Just let it run! No action needed.
When it occurs: - Many concurrent downloads (20+) - Downloading rapidly from multiple channels - Downloading many large files - Normal and expected behavior
To reduce rate limiting:
-
Lower concurrent downloads:
-
Add delays in scripts:
-
Download in batches:
Note: The automatic waiting in v1.2.0+ means you rarely need to do anything - just let tgdl handle it!
Duplicate downloads
In v1.2.0+: This is automatically prevented by hash-based deduplication!
How it works:
- Each downloaded file gets an MD5 hash
- If the same file appears in multiple messages, tgdl recognizes it
- Duplicate is automatically skipped
- Shows: ⊘ Duplicate of original_name.jpg — removing copy.
Example:
# Download from channel (gets image: photo123.jpg)
$ tgdl download -c 1234567890 --limit 10
✓ Downloaded photo123.jpg (2.5MB)
# Later, same image appears in different message (as photo456.jpg)
$ tgdl download -c 1234567890 --limit 20
Using 10 already downloaded files
⊘ Duplicate of photo123.jpg — removing copy. (was named photo456.jpg)
# Only 10 NEW files downloaded (not 20)
Benefits: - Saves bandwidth - Saves disk space - Works across interruptions and resume - Transparent and automatic
Verifying deduplication:
# Check for duplicate removals in output
$ tgdl download -c 1234567890
...
⊘ Duplicate of file1.jpg — removing copy.
⊘ Duplicate of file2.jpg — removing copy.
...
If this was happening in older versions: 1. Update tgdl:
- Check version is 1.2.0+:
Permission Issues
Cannot create directory
Symptom:
Solutions:
-
Use different output directory:
-
Check directory permissions:
-
Run without sudo:
- Don't use sudo with tgdl
- Use user directory instead
Cannot write file
Symptom:
Solutions:
-
Check available disk space:
-
Check file already exists:
-
Delete if corrupted
-
Change output directory:
API Credential Issues
Invalid API credentials
Symptom:
Solutions:
- Verify credentials:
- Go to https://my.telegram.org/apps
-
Check API ID and Hash
-
Re-enter credentials:
-
Enter correct API ID and Hash
-
Check for typos:
- API ID: numbers only
- API Hash: 32 character alphanumeric string
API credentials not found
Symptom:
Solution:
Login first:
This will prompt for API credentials.
File Issues
Files not named correctly
Symptom: Files named generically (photo.jpg) instead of with message ID
This is expected for: - Old versions (pre-1.1.0) - Single file downloads via download-link
For regular downloads:
- Should be named: {message_id}.{extension}
- Example: 12345.jpg
If incorrect: 1. Update tgdl:
- Re-download:
Corrupted files
Symptom: Files won't open or are incomplete
Solutions:
- Check file size:
-
Very small files (< 1KB) may be corrupted
-
Delete and re-download:
-
Check disk space:
-
Insufficient space can cause corruption
-
Download interrupted:
- Run download again to resume
Configuration Issues
Config file not found
Symptom:
Solution:
Login to create config:
Cannot read config file
Symptom:
Solutions:
-
Check file permissions:
-
Reset configuration:
-
Manually remove config:
Progress Tracking Issues
Progress not saved
Symptom: Downloads start from beginning each time
Solutions:
-
Check progress file:
-
Verify file permissions:
-
Reset progress:
Wrong progress tracking
Symptom: Downloads skip files that weren't downloaded
Solutions:
- Check progress file:
-
Shows last downloaded message ID per entity
-
Reset progress for entity:
-
Or reset all progress:
Command Issues
Command not found
Symptom:
Solutions:
-
Check installation:
-
Add to PATH:
-
Use python -m:
-
Reinstall:
Invalid command/option
Symptom:
Solutions:
-
Check help:
-
Verify spelling:
-
Check command structure:
Platform-Specific Issues
Windows: PowerShell encoding issues
Symptom: Unicode characters display incorrectly
Solution:
Set UTF-8 encoding:
Add to PowerShell profile to make permanent:
Linux: SSL certificate errors
Symptom:
Solutions:
-
Update certificates:
-
Update Python certifi:
macOS: notarization warnings
Symptom: Security warnings when running tgdl
Solution:
This shouldn't happen with pip installations. If it does:
Performance Issues
High memory usage
Symptom: System slows down during download
Solutions:
-
Reduce concurrent downloads:
-
Download in smaller batches:
-
Close other applications:
- Free up RAM
-
Close browser tabs
-
Check system resources:
High disk usage
Symptom: Disk space fills up quickly
Solutions:
-
Use size limits:
-
Use download limits:
-
Check available space first:
-
Clean old downloads:
Getting Help
Check logs
Download logs:
System info:
# Python version
python --version
# tgdl version
pip show tgdl
# OS info
uname -a # Linux/macOS
systeminfo # Windows
Report bugs
On GitHub: https://github.com/kavidu-dilhara/tgdl/issues
Include:
1. tgdl version (pip show tgdl)
2. Python version (python --version)
3. Operating system
4. Full error message
5. Command you ran
6. Expected vs actual behavior
Ask for help
Provide: - What you're trying to do - What command you ran - Full error message (if any) - What you've tried so far
Example:
I'm trying to download videos from a channel but getting zero files.
Command: tgdl download -c 1234567890 -v
Output: ⚠ No files downloaded.
I can see the channel has videos in Telegram app.
I've tried without filters and still get zero files.
tgdl version: 1.1.4
Python version: 3.9.7
OS: Ubuntu 22.04
Quick Diagnosis
Checklist for issues:
- Latest tgdl version? (
pip install --upgrade tgdl) - Python 3.7+? (
python --version) - Logged in? (
tgdl status) - Member of channel/group?
- Correct entity flag (-c/-g/-b)?
- Internet connection working?
- Enough disk space?
- Correct API credentials?
Common fixes:
# Update tgdl
pip install --upgrade tgdl
# Reset session
tgdl logout
tgdl login
# Test with minimal command
tgdl download -c 1234567890 --limit 3
# Check status
tgdl status