Version: 1.0.0
Updated: 2024-01-20
Target Audience: All Users
Run these commands to quickly identify common issues:
# Check if tool is properly installed
telegram-audio-downloader --version
# Test basic functionality
telegram-audio-downloader test-connection
# Check configuration
telegram-audio-downloader config --show
# Verify dependencies
python -c "import telethon, mutagen, peewee; print('Dependencies OK')"
# System information
python --version
pip --version
telegram-audio-downloader --version
# Check available disk space
df -h
# Check memory usage
free -h # Linux
vm_stat | head -5 # macOS
# Check recent logs for errors
telegram-audio-downloader logs --last 50
# Verbose mode for detailed output
telegram-audio-downloader download @test --verbose --dry-run
telegram-audio-downloader: command not found
Symptoms:
pip install
completed successfullySolutions:
# Check if pip bin directory is in PATH
python -m pip show telegram-audio-downloader
# Add to PATH (add to ~/.bashrc or ~/.zshrc)
export PATH="$HOME/.local/bin:$PATH"
# Reload shell
source ~/.bashrc # or ~/.zshrc
# Run as module instead
python -m telegram_audio_downloader download @group
# Create virtual environment
python -m venv telegram-downloader
source telegram-downloader/bin/activate # Linux/macOS
# telegram-downloader\Scripts\activate # Windows
# Install in virtual environment
pip install telegram-audio-downloader
ModuleNotFoundError
during installationSymptoms:
ModuleNotFoundError: No module named 'telegram_audio_downloader'
Solutions:
# Ensure Python 3.8+
python --version
# Use specific Python version if needed
python3.11 -m pip install telegram-audio-downloader
# If installing from source
git clone https://github.com/Elpablo777/Telegram-Audio-Downloader.git
cd Telegram-Audio-Downloader
pip install -e .
Symptoms:
ERROR: pip's dependency resolver does not currently consider all the packages
Solutions:
# Uninstall conflicting packages
pip uninstall telethon telegram-audio-downloader
# Clear pip cache
pip cache purge
# Fresh installation
pip install --no-cache-dir telegram-audio-downloader
# Install with exact versions
pip install telegram-audio-downloader==1.0.0
Invalid API ID or Hash
Symptoms:
Solutions:
# Check .env file exists and has correct format
cat .env
# Ensure no extra spaces or quotes
API_ID=1234567
API_HASH=abcdef1234567890abcdef1234567890
# Set as environment variables
export API_ID=1234567
export API_HASH=abcdef1234567890abcdef1234567890
# Or pass directly
telegram-audio-downloader download @group --api-id 1234567 --api-hash abcdef...
Phone number required
Symptoms:
Solutions:
# Specify session name
telegram-audio-downloader download @group --session-name my_session
# Check session file location
ls ~/.local/share/telegram-audio-downloader/
# auth_setup.py
import asyncio
from telethon import TelegramClient
async def setup_auth():
client = TelegramClient('my_session', API_ID, API_HASH)
await client.start()
print("Authentication successful!")
await client.disconnect()
asyncio.run(setup_auth())
Two-factor authentication required
Symptoms:
Solutions:
# Run with interactive mode
telegram-audio-downloader auth --interactive
# Or use specific command
telegram-audio-downloader setup-2fa
# Set 2FA password in environment
export TELEGRAM_2FA_PASSWORD=your_password
# Or in .env file
TELEGRAM_2FA_PASSWORD=your_password
No audio files found
Symptoms:
Solutions:
# Check if group exists and is accessible
telegram-audio-downloader info @group_name
# Try with group ID instead of username
telegram-audio-downloader download -1001234567890
# Remove file type restrictions
telegram-audio-downloader download @group --file-types all
# Increase search limit
telegram-audio-downloader download @group --limit 1000
# Check different date ranges
telegram-audio-downloader download @group --date-from 2023-01-01
# Use search command to debug
telegram-audio-downloader search @group --limit 100 --verbose
Download interrupted
or Partial downloads
Symptoms:
Solutions:
# Resume incomplete downloads
telegram-audio-downloader resume
# Or restart with skip-existing
telegram-audio-downloader download @group --skip-existing
# More robust download with retries
telegram-audio-downloader download @group \
--max-retries 5 \
--retry-delay 3 \
--timeout 30
# Lower concurrent downloads
telegram-audio-downloader download @group --max-concurrent 1
File corruption
or Invalid audio files
Symptoms:
Solutions:
# Download with integrity checking
telegram-audio-downloader download @group --verify-downloads
# Post-download verification
telegram-audio-downloader verify --check-integrity
# Remove corrupted files
telegram-audio-downloader cleanup --remove-corrupted
# Re-download specific files
telegram-audio-downloader download @group --force-redownload file_id_123
Slow download speeds
Symptoms:
Solutions:
# Increase concurrent downloads
telegram-audio-downloader download @group --max-concurrent 8
# Reduce rate limiting
telegram-audio-downloader download @group --rate-limit 0.5
# Use different Telegram DC
telegram-audio-downloader download @group --dc-id 2
# Check network speed
speedtest-cli
# Check system resources
htop # or top
iostat 1 # check disk I/O
# Free up memory
telegram-audio-downloader cleanup --clear-cache
High memory usage
Symptoms:
Solutions:
# Reduce memory usage
telegram-audio-downloader download @group \
--max-concurrent 2 \
--memory-limit 512MB \
--cleanup-frequency 10
# Process in smaller batches
for i in {1..10}; do
telegram-audio-downloader download @group \
--limit 50 \
--offset $((i * 50)) \
--skip-existing
sleep 10
done
High CPU usage
Symptoms:
Solutions:
# Limit CPU usage (Linux)
cpulimit -l 50 telegram-audio-downloader download @group
# Use nice to lower priority
nice -n 10 telegram-audio-downloader download @group
# Disable metadata extraction
telegram-audio-downloader download @group --no-metadata
# Disable file verification
telegram-audio-downloader download @group --no-verify
Rate limit exceeded
Symptoms:
Solutions:
# Increase delay between requests
telegram-audio-downloader download @group --rate-limit 3.0
# Use flood wait handling
telegram-audio-downloader download @group --handle-flood-wait
# Custom retry script with backoff
import asyncio
import time
async def download_with_backoff():
backoff = 1
max_backoff = 300 # 5 minutes
while True:
try:
result = await downloader.download_audio_files("@group")
break
except FloodWaitError as e:
wait_time = min(e.seconds, max_backoff)
print(f"Flood wait: {wait_time}s")
await asyncio.sleep(wait_time)
except Exception as e:
print(f"Error: {e}, backing off {backoff}s")
await asyncio.sleep(backoff)
backoff = min(backoff * 2, max_backoff)
Account temporarily restricted
Symptoms:
Solutions:
# Stop all downloading activity
pkill -f telegram-audio-downloader
# Wait 24 hours before trying again
# Use more conservative settings when resuming
telegram-audio-downloader download @group \
--rate-limit 5.0 \
--max-concurrent 1
# Create new session with different phone number
telegram-audio-downloader auth --session-name backup_session
Disk space full
Symptoms:
Solutions:
# Check disk usage
df -h
du -sh downloads/
# Clean up old downloads
find downloads/ -name "*.mp3" -mtime +30 -delete
# Compress old files
find downloads/ -name "*.mp3" -mtime +7 -exec gzip {} \;
# Set maximum storage for downloads
telegram-audio-downloader download @group --max-storage 10GB
# Move to external storage
telegram-audio-downloader download @group --download-dir /mnt/external/music
Permission denied
errorsSymptoms:
Solutions:
# Make download directory writable
chmod 755 downloads/
chown $USER:$USER downloads/
# Create directory if it doesn't exist
mkdir -p downloads && chmod 755 downloads/
# Download to home directory
telegram-audio-downloader download @group --download-dir ~/Music
# Use temp directory
telegram-audio-downloader download @group --download-dir /tmp/music
Filename encoding issues
Symptoms:
Solutions:
# Force UTF-8 encoding
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# Use ASCII-safe filenames
telegram-audio-downloader download @group --ascii-filenames
# Custom filename cleaning
import re
def clean_filename(filename):
# Remove invalid characters
filename = re.sub(r'[<>:"/\\|?*]', '_', filename)
# Limit length
if len(filename) > 200:
name, ext = os.path.splitext(filename)
filename = name[:200-len(ext)] + ext
return filename
Connection timeouts
Symptoms:
Solutions:
# Increase connection timeout
telegram-audio-downloader download @group --timeout 60
# Use different proxy or VPN
telegram-audio-downloader download @group --proxy socks5://localhost:1080
# Test basic connectivity
ping telegram.org
# Test specific Telegram servers
telnet 149.154.167.50 443
Proxy configuration issues
Symptoms:
Solutions:
# SOCKS5 proxy
telegram-audio-downloader download @group \
--proxy socks5://username:password@localhost:1080
# HTTP proxy
telegram-audio-downloader download @group \
--proxy http://proxy.example.com:8080
# Test proxy connectivity
curl --proxy socks5://localhost:1080 http://httpbin.org/ip
Firewall blocking connections
Symptoms:
Solutions:
# Linux: Check iptables
sudo iptables -L
# macOS: Check built-in firewall
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate
# Windows: Check Windows Firewall
netsh advfirewall show allprofiles
# Allow Telegram ports (443, 80, 5222)
sudo ufw allow 443
sudo ufw allow 80
sudo ufw allow 5222
Configuration file not found
Symptoms:
Solutions:
# Generate default config
telegram-audio-downloader config --init
# Edit configuration
telegram-audio-downloader config --edit
# Use specific config file
telegram-audio-downloader download @group --config ~/my-config.ini
# Set config environment variable
export TELEGRAM_DOWNLOADER_CONFIG=~/my-config.ini
Invalid configuration values
Symptoms:
Solutions:
# Check configuration syntax
telegram-audio-downloader config --validate
# Show current configuration
telegram-audio-downloader config --show
# Reset to defaults
telegram-audio-downloader config --reset
# Remove corrupt config
rm ~/.config/telegram-audio-downloader/config.ini
# Maximum verbosity
telegram-audio-downloader download @group --debug --verbose
# Save debug logs
telegram-audio-downloader download @group --debug --log-file debug.log
# debug_session.py
import asyncio
import logging
from telegram_audio_downloader.downloader import AudioDownloader
# Enable all logging
logging.basicConfig(level=logging.DEBUG)
async def debug_download():
downloader = AudioDownloader()
try:
await downloader.initialize_client()
# Test basic functionality
info = await downloader.get_group_info("@test_group")
print(f"Group info: {info}")
# Test search
messages = await downloader.search_messages("@test_group", limit=1)
print(f"Found {len(messages)} messages")
except Exception as e:
import traceback
traceback.print_exc()
finally:
await downloader.close()
asyncio.run(debug_download())
# Monitor network traffic
tcpdump -i any host 149.154.167.50
# Check DNS resolution
nslookup telegram.org
# Test with curl
curl -v https://api.telegram.org/bot
# Check database state
from telegram_audio_downloader.models import AudioFile, TelegramGroup
# Count records
print(f"Audio files: {AudioFile.select().count()}")
print(f"Groups: {TelegramGroup.select().count()}")
# Check for issues
for audio_file in AudioFile.select().where(AudioFile.local_path.is_null(False)):
if not os.path.exists(audio_file.local_path):
print(f"Missing file: {audio_file.local_path}")
# Monitor during download
# Terminal 1: Start download
telegram-audio-downloader download @large_group --debug
# Terminal 2: Monitor resources
watch -n 1 'ps aux | grep telegram-audio-downloader'
watch -n 1 'free -h'
watch -n 1 'df -h'
telegram-audio-downloader --debug --verbose
Include this information in bug reports:
# System information
telegram-audio-downloader --version
python --version
uname -a # Linux/macOS
ver # Windows
# Error reproduction
telegram-audio-downloader download @problem_group --debug --verbose 2>&1 | tee error.log
# Configuration (remove sensitive data)
telegram-audio-downloader config --show | grep -v -E "(API_|password|token)"
For enterprise users or complex deployments, consider:
Error Code | Description | Solution |
---|---|---|
AUTH_ERROR_001 | Invalid API credentials | Check API_ID and API_HASH |
DOWNLOAD_ERROR_002 | File not found | Verify group access and file existence |
NETWORK_ERROR_003 | Connection timeout | Check network and increase timeout |
STORAGE_ERROR_004 | Disk space full | Free up space or change download directory |
RATE_LIMIT_005 | Too many requests | Increase rate limiting delay |
SESSION_ERROR_006 | Invalid session | Delete session file and re-authenticate |
PERMISSION_ERROR_007 | Access denied | Check file/directory permissions |
CONFIG_ERROR_008 | Invalid configuration | Validate and fix configuration file |
For additional help, visit our GitHub repository or community discussions.
Last updated: 2024-01-20
Version: 1.0.0