PyRadio provides a powerful playlist validation system, with multi-threading support and host-aware throttling.
[ 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.
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:
To prevent server banning, the tool: - Groups requests by hostname - Applies separate semaphore for each host - Limits concurrent requests per host (default: 2)
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.
The tool displays a detailed summary including:
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.