PyRadio provides a powerful playlist validation system, with multi-threading support and host-aware throttling.
- Overview
- Features
- Usage
- Technical Details
- Output Files
- Results Summary
- Usage Tips
- Troubleshooting
- Contributing
[ Back to main doc ] [ Related: M3U Playlist Support ]
This tool allows validation of radio stations in playlist files (CSV or M3U) to ensure all links are functional and provide actual playable audio content.
- Multi-threaded validation: Validate multiple stations simultaneously
- Host-aware throttling: Limit requests per host to prevent server banning
- Smart audio detection: Detect actual audio streams through multiple methods
- Flexible output options: Mark non-functional stations or save to separate files
- Colorized output: Readable results with color coding
pyradio [options] --validate <mode> --convert <playlist_file>
| Option | Default | Description |
|---|---|---|
| --validate | mark | Validation mode (mark or drop) |
| --threads | 5 | Number of threads for parallel processing |
| --timeout | 5 | Timeout in seconds per request |
| --max-per-host | 2 | Maximum concurrent requests per host |
| --with-date | False | Add timestamp to output filenames |
| --no-color | False | Disable color output |
| --quiet | False | Reduce verbosity (hide per-station output) |
Marks non-functional stations with "[X]" in the name and saves all results to one file.
pyradio --validate --convert my_playlist.csv
Creates two separate files:
- .ok: Working stations
- .bad: Non-working stations
Example:
pyradio --validate drop my_playlist.m3u
Basic validation:
pyradio --validate mark --convert playlist.csv
Validation with 10 threads and stricter timeout:
pyradio --validate drop --threads 10 --timeout 3 --convert playlist.m3u
Validation with timestamp and without colors:
pyradio --validate mark --with-date --no-color --convert playlist.csv
Quiet validation (summary only):
pyradio --validate mark --quiet --convert playlist.m3u
The tool uses multiple techniques to determine if a URL provides actual audio stream:
- Content-Type check: Verifies content type is audio/video
- ICY headers detection: Checks for Shoutcast/Icecast headers
- Audio signature analysis: Detects patterns of common audio formats (MP3, AAC, OGG, FLAC, etc.)
- HTML exclusion: Rejects HTML responses indicating errors or pages
To prevent server banning, the tool:
- Groups requests by hostname
- Applies separate semaphore for each host
- Limits concurrent requests per host (default: 2)
- CSV: Files with PyRadio CSV formatting
- M3U: Standard M3U playlist files
Note: If you provide a URL instead of a file path, PyRadio will treat it as a link to an online M3U file and attempt to download and validate it.
- "playlist.validated.[timestamp].csv/m3u": File with marked non-functional stations
- "playlist.ok.[timestamp].csv/m3u": Working stations
- "playlist.bad.[timestamp].csv/m3u": Non-working stations
The tool displays a detailed summary including:
- Number of online/offline stations
- Number of groups (group headers)
- Success rate
- Total counts
- For large playlists: Use more threads ("--threads") for faster processing
- For sensitive servers: Reduce "--max-per-host" to avoid banning
- For scheduled validations: Use "--with-date" for history
- For scripting: Use "--no-color --quiet" for machine-readable output
Error: "Cannot write file"
- Ensure you have write permissions in the directory
Error: "Unsupported file type"
- Ensure the file has .csv or .m3u extension
Many non-functional stations
- Check your network connection
- Increase "--timeout" for slow servers
- Check if stations require specific headers/referrer
Any improvements to the validation algorithm or new detection techniques are welcome.