Skip to content

Commit f5f400e

Browse files
committed
updating docs
1 parent b2318e9 commit f5f400e

File tree

9 files changed

+416
-2
lines changed

9 files changed

+416
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Command line internet radio player.
3737
- Configuration editor
3838
- Search function
3939
- Customizable key bindings
40+
- Playlist validation support
4041
- Easy installation / updating
4142
- Runs on Linux, macOS and Windows
4243

devel/pre-commit

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ for afile in index.md \
158158
client.md \
159159
rec-dir.md \
160160
buffering.md \
161-
m3u.md
161+
m3u.md \
162+
validate_playlist.md
162163
do
163164
sed -i -e "s/'s-/s-/g" -e "s/s'-/s-/g" "$afile"
164165
git add "$afile"
@@ -205,6 +206,8 @@ do
205206
echo '% PyRadio Buffering' > tmp.md
206207
elif [ "$afile" = "m3u.md" ];then
207208
echo '% PyRadio M3U Playlist Support' > tmp.md
209+
elif [ "$afile" = "validate_playlist.md" ];then
210+
echo '% PyRadio Playlist Validation Guide' > tmp.md
208211
fi
209212
cat ${afile} >> tmp.md
210213
pandoc --wrap=none -s -t html tmp.md -o ${out} || {

docs/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ <h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><
7373
<li><a href="#managing-playlists-(within-pyradio)">Managing playlists (within PyRadio)</a></li>
7474
<li><a href="#managing-foreign-playlists">Managing foreign playlists</a></li>
7575
<li><a href="#playlist-history">Playlist history</a></li>
76+
<li><a href="#playlist-validation-support">Playlist validation support</a></li>
7677
</ul></li>
7778
<li><a href="#stations-history">Stations history</a></li>
7879
<li><a href="#search-function">Search function</a></li>
@@ -169,6 +170,7 @@ <h2 id="features">Features <span style="padding-left: 10px;"><sup style="font-si
169170
<li>Configuration editor</li>
170171
<li>Search function</li>
171172
<li>Customizable key bindings</li>
173+
<li>Playlist validation support</li>
172174
<li>Easy installation / updating</li>
173175
<li>Runs on Linux, macOS and Windows</li>
174176
</ul>
@@ -1967,6 +1969,9 @@ <h3 id="playlist-history">Playlist history</h3>
19671969
<p><strong>PyRadio</strong> will keep a history of all the playlists opened (within a given session), so that navigating between them is made easy.</p>
19681970
<p>In order to go back to the previous playlist, the user just has to press “<strong>\\</strong>” (double backslash). To get to the first playlist “<strong>\]</strong>” (backslash - closing square bracket) can be used.</p>
19691971
<p>Going forward in history is not supported.</p>
1972+
<h3 id="playlist-validation-support">Playlist validation support</h3>
1973+
<p><strong>PyRadio</strong> provides a powerful playlist validation system, with multi-threading support and host-aware throttling for both <strong>CSV</strong> and <strong>M3U</strong> playlists.</p>
1974+
<p>More info: <a href="validate_playlist.html">PyRadio Playlist Validation Guide</a></p>
19701975
<h2 id="stations-history">Stations history <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
19711976
<p>Playing several stations, sometimes among different playlists, and returning to them is sometimes a tedious operation.</p>
19721977
<p>This problem is addressed with the “<strong>Station history</strong>” functionality, which is actually a list of stations which have been played back.</p>

docs/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Command line internet radio player.
2929
* [Managing playlists (within PyRadio)](#managing-playlists-(within-pyradio))
3030
* [Managing foreign playlists](#managing-foreign-playlists)
3131
* [Playlist history](#playlist-history)
32+
* [Playlist validation support](#playlist-validation-support)
3233
* [Stations history](#stations-history)
3334
* [Search function](#search-function)
3435
* [Line editor](#line-editor)
@@ -96,6 +97,7 @@ Command line internet radio player.
9697
- Configuration editor
9798
- Search function
9899
- Customizable key bindings
100+
- Playlist validation support
99101
- Easy installation / updating
100102
- Runs on Linux, macOS and Windows
101103

@@ -647,6 +649,13 @@ In order to go back to the previous playlist, the user just has to press "**\\\\
647649

648650
Going forward in history is not supported.
649651

652+
### Playlist validation support
653+
654+
655+
**PyRadio** provides a powerful playlist validation system, with multi-threading support and host-aware throttling for both **CSV** and **M3U** playlists.
656+
657+
More info: [PyRadio Playlist Validation Guide](validate_playlist.md)
658+
650659
## Stations history
651660

652661
Playing several stations, sometimes among different playlists, and returning to them is sometimes a tedious operation.

docs/m3u.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@
3838
</header>
3939
<h1 style="color: SaddleBrown" id="pyradio-m3u-playlist-support">PyRadio M3U Playlist Support</h1>
4040
<p><strong>PyRadio</strong> offers seamless two-way conversion between its native CSV playlist format and the widely supported M3U format. This functionality allows you to import radio stations from external M3U sources and export your <strong>PyRadio</strong> stations to share with other media players.</p>
41+
<h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
42+
<!-- vim-markdown-toc Marked -->
43+
<ul>
44+
<li><a href="#what-you-can-do">What You Can Do</a>
45+
<ul>
46+
<li><a href="#convert-m3u-to-pyradio-csv">Convert M3U to PyRadio CSV</a></li>
47+
<li><a href="#convert-pyradio-csv-to-m3u">Convert PyRadio CSV to M3U</a></li>
48+
</ul></li>
49+
<li><a href="#character-conversions-in-csv→m3u-conversion">Character Conversions in CSV→M3U Conversion</a></li>
50+
<li><a href="#field-correspondence">Field Correspondence</a></li>
51+
<li><a href="#command-line-usage">Command Line Usage</a></li>
52+
</ul>
53+
<!-- vim-markdown-toc -->
54+
<p class="indented">[ <a href="index.html">Back to main doc</a> ]</p>
4155
<h2 id="what-you-can-do">What You Can Do <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
4256
<h3 id="convert-m3u-to-pyradio-csv">Convert M3U to PyRadio CSV</h3>
4357
<p>When you have an M3U playlist file (from another media player or online source), <strong>PyRadio</strong> can convert it to its CSV format while preserving important metadata like station logos and group categories. The conversion process:</p>

docs/m3u.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
**PyRadio** offers seamless two-way conversion between its native CSV playlist format and the widely supported M3U format. This functionality allows you to import radio stations from external M3U sources and export your **PyRadio** stations to share with other media players.
44

5+
## Table of Contents
6+
7+
<!-- vim-markdown-toc Marked -->
8+
9+
* [What You Can Do](#what-you-can-do)
10+
* [Convert M3U to PyRadio CSV](#convert-m3u-to-pyradio-csv)
11+
* [Convert PyRadio CSV to M3U](#convert-pyradio-csv-to-m3u)
12+
* [Character Conversions in CSV→M3U Conversion](#character-conversions-in-csv→m3u-conversion)
13+
* [Field Correspondence](#field-correspondence)
14+
* [Command Line Usage](#command-line-usage)
15+
16+
<!-- vim-markdown-toc -->
17+
18+
[ [Back to main doc](index.md) ]
19+
20+
521
## What You Can Do
622

723
### Convert M3U to PyRadio CSV

docs/validate_playlist.html

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="generator" content="pandoc" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
7+
<title>PyRadio Playlist Validation Guide</title>
8+
<style>
9+
body {padding: 2em;}
10+
@media screen and (max-width: 770px) {
11+
body {padding: 10px;}
12+
}
13+
body {max-width: 750px; margin: auto;}
14+
h2 {margin-top: 2.5em; border-bottom:1px solid SaddleBrown; color: SaddleBrown;}
15+
h3 {margin-top: 2em; color: SaddleBrown; text-decoration: underline SaddleBrown}
16+
h4 {margin: 2em 0 1em 0; color: SaddleBrown; font-size: 1em;}
17+
h4:before {content: "# "; font-weight: bold; vertical-align: middle;}
18+
h5 {margin: 2em 0 1em 0; color: SaddleBrown; font-size: 1em;;}
19+
h5:before {content: "## "; font-weight: bold; vertical-align: middle;}
20+
p, table, ol, ul {margin-left: .8em;}
21+
STRONG {color: SaddleBrown;}
22+
dl {margin: 2em;}
23+
dd {margin: 1em;}
24+
dt {font-weight: bold;}
25+
TABLE {border: 1px solid SaddleBrown; border-collapse: collapse; margin-left: auto; margin-right: auto; border-radius: 5px; -moz-border-radius: 5px; border-collapse:separate; box-shadow: 5px 5px 15px #888888;}
26+
TH {text-align: left; vertical-align: top; padding: 5px;color: SaddleBrown;border: 1px solid SaddleBrown; background-color: SaddleBrown; color: white;}
27+
TD {text-align: left; vertical-align: top; padding: 5px 10px;border: 1px solid SaddleBrown;}
28+
pre { background-color: rgba(245, 245, 245, 1); color: #474747; padding: 1.5em; border: 1px solid #C7C7C7; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; overflow: auto; box-shadow: 5px 5px 15px #C7C7C7;}
29+
.task-list {list-style-type: none; padding: 0; margin: 0 0 0 1em ;}
30+
img{display: block; margin-left: auto; margin-right: auto; max-width: 750px; width: 100%; background:transparent; padding:3px; border:1px solid #999999; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; box-shadow:5px 5px 15px #888888;}
31+
.indented {text-indent: -1.5em; padding-left: 1.5em; margin-left: 1em;}
32+
a{ color: SaddleBrown;}
33+
a:visited{color: SaddleBrown;}
34+
</style>
35+
</head>
36+
<body>
37+
<header id="title-block-header">
38+
</header>
39+
<h1 style="color: SaddleBrown" id="pyradio-playlist-validation-guide">PyRadio Playlist Validation Guide</h1>
40+
<p><strong>PyRadio</strong> provides a powerful playlist validation system, with multi-threading support and host-aware throttling.</p>
41+
<h2 id="table-of-contents">Table of Contents <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
42+
<!-- vim-markdown-toc Marked -->
43+
<ul>
44+
<li><a href="#overview">Overview</a></li>
45+
<li><a href="#features">Features</a></li>
46+
<li><a href="#usage">Usage</a>
47+
<ul>
48+
<li><a href="#basic-syntax">Basic Syntax</a></li>
49+
<li><a href="#validation-options">Validation Options</a></li>
50+
<li><a href="#validation-modes">Validation Modes</a>
51+
<ul>
52+
<li><a href="#mark-mode-(default)">mark mode (default)</a></li>
53+
<li><a href="#drop-mode">drop mode</a></li>
54+
</ul></li>
55+
<li><a href="#usage-examples">Usage Examples</a></li>
56+
</ul></li>
57+
<li><a href="#technical-details">Technical Details</a>
58+
<ul>
59+
<li><a href="#validation-algorithm">Validation Algorithm</a></li>
60+
<li><a href="#host-aware-throttling">Host-Aware Throttling</a></li>
61+
<li><a href="#supported-formats">Supported Formats</a></li>
62+
</ul></li>
63+
<li><a href="#output-files">Output Files</a>
64+
<ul>
65+
<li><a href="#mark-mode">mark mode</a></li>
66+
<li><a href="#drop-mode">drop mode</a></li>
67+
</ul></li>
68+
<li><a href="#results-summary">Results Summary</a></li>
69+
<li><a href="#usage-tips">Usage Tips</a></li>
70+
<li><a href="#troubleshooting">Troubleshooting</a></li>
71+
<li><a href="#contributing">Contributing</a></li>
72+
</ul>
73+
<!-- vim-markdown-toc -->
74+
<p class="indented">[ <a href="index.html#playlist-validation-support">Back to main doc</a> ]</p>
75+
<h2 id="overview">Overview <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
76+
<p>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.</p>
77+
<h2 id="features">Features <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
78+
<ul>
79+
<li><strong>Multi-threaded validation</strong>: Validate multiple stations simultaneously</li>
80+
<li><strong>Host-aware throttling</strong>: Limit requests per host to prevent server banning</li>
81+
<li><strong>Smart audio detection</strong>: Detect actual audio streams through multiple methods</li>
82+
<li><strong>Flexible output options</strong>: Mark non-functional stations or save to separate files</li>
83+
<li><strong>Colorized output</strong>: Readable results with color coding</li>
84+
</ul>
85+
<h2 id="usage">Usage <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
86+
<h3 id="basic-syntax">Basic Syntax</h3>
87+
<pre>pyradio [options] --validate &lt;mode&gt; --convert &lt;playlist_file&gt;</pre>
88+
<h3 id="validation-options">Validation Options</h3>
89+
<table>
90+
<thead>
91+
<tr>
92+
<th>Option</th>
93+
<th>Default</th>
94+
<th>Description</th>
95+
</tr>
96+
</thead>
97+
<tbody>
98+
<tr>
99+
<td>–validate</td>
100+
<td>mark</td>
101+
<td>Validation mode (<strong>mark</strong> or <strong>drop</strong>)</td>
102+
</tr>
103+
<tr>
104+
<td>–threads</td>
105+
<td>5</td>
106+
<td>Number of threads for parallel processing</td>
107+
</tr>
108+
<tr>
109+
<td>–timeout</td>
110+
<td>5</td>
111+
<td>Timeout in seconds per request</td>
112+
</tr>
113+
<tr>
114+
<td>–max-per-host</td>
115+
<td>2</td>
116+
<td>Maximum concurrent requests per host</td>
117+
</tr>
118+
<tr>
119+
<td>–with-date</td>
120+
<td>False</td>
121+
<td>Add timestamp to output filenames</td>
122+
</tr>
123+
<tr>
124+
<td>–no-color</td>
125+
<td>False</td>
126+
<td>Disable color output</td>
127+
</tr>
128+
<tr>
129+
<td>–quiet</td>
130+
<td>False</td>
131+
<td>Reduce verbosity (hide per-station output)</td>
132+
</tr>
133+
</tbody>
134+
</table>
135+
<h3 id="validation-modes">Validation Modes</h3>
136+
<h4 id="mark-mode-default">mark mode (default)</h4>
137+
<p>Marks non-functional stations with “<em>[X]</em>” in the name and saves all results to one file.</p>
138+
<pre>pyradio --validate --convert my_playlist.csv</pre>
139+
<h4 id="drop-mode">drop mode</h4>
140+
<p>Creates two separate files: - <strong>.ok</strong>: Working stations - <strong>.bad</strong>: Non-working stations</p>
141+
<p>Example:</p>
142+
<pre>pyradio --validate drop my_playlist.m3u</pre>
143+
<h3 id="usage-examples">Usage Examples</h3>
144+
<p><strong>Basic validation:</strong></p>
145+
<pre>pyradio --validate mark --convert playlist.csv</pre>
146+
<p><strong>Validation with 10 threads and stricter timeout:</strong></p>
147+
<pre>pyradio --validate drop --threads 10 --timeout 3 --convert playlist.m3u</pre>
148+
<p><strong>Validation with timestamp and without colors:</strong></p>
149+
<pre>pyradio --validate mark --with-date --no-color --convert playlist.csv</pre>
150+
<p><strong>Quiet validation (summary only):</strong></p>
151+
<pre>pyradio --validate mark --quiet --convert playlist.m3u</pre>
152+
<h2 id="technical-details">Technical Details <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
153+
<h3 id="validation-algorithm">Validation Algorithm</h3>
154+
<p>The tool uses multiple techniques to determine if a URL provides actual audio stream:</p>
155+
<ol type="1">
156+
<li><strong>Content-Type check</strong>: Verifies content type is audio/video</li>
157+
<li><strong>ICY headers detection</strong>: Checks for Shoutcast/Icecast headers</li>
158+
<li><strong>Audio signature analysis</strong>: Detects patterns of common audio formats (MP3, AAC, OGG, FLAC, etc.)</li>
159+
<li><strong>HTML exclusion</strong>: Rejects HTML responses indicating errors or pages</li>
160+
</ol>
161+
<h3 id="host-aware-throttling">Host-Aware Throttling</h3>
162+
<p>To prevent server banning, the tool: - Groups requests by hostname - Applies separate semaphore for each host - Limits concurrent requests per host (default: 2)</p>
163+
<h3 id="supported-formats">Supported Formats</h3>
164+
<ul>
165+
<li><strong>CSV</strong>: Files with <strong>PyRadio</strong> CSV formatting</li>
166+
<li><strong>M3U</strong>: Standard M3U playlist files</li>
167+
</ul>
168+
<p style="margin: 1.5em 4em 0 4em; text-indent: -2.5em;"><strong>Note:</strong> If you provide a URL instead of a file path, <strong>PyRadio</strong> will treat it as a link to an online M3U file and attempt to download and validate it.</p>
169+
<h2 id="output-files">Output Files <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
170+
<h3 id="mark-mode">mark mode</h3>
171+
<ul>
172+
<li><em>playlist.validated.[timestamp].csv/m3u</em>”: File with marked non-functional stations</li>
173+
</ul>
174+
<h3 id="drop-mode-1">drop mode</h3>
175+
<ul>
176+
<li><em>playlist.ok.[timestamp].csv/m3u</em>”: Working stations</li>
177+
<li><em>playlist.bad.[timestamp].csv/m3u</em>”: Non-working stations</li>
178+
</ul>
179+
<h2 id="results-summary">Results Summary <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
180+
<p>The tool displays a detailed summary including:</p>
181+
<ul>
182+
<li>Number of online/offline stations</li>
183+
<li>Number of groups (group headers)</li>
184+
<li>Success rate</li>
185+
<li>Total counts</li>
186+
</ul>
187+
<h2 id="usage-tips">Usage Tips <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
188+
<ol type="1">
189+
<li><strong>For large playlists</strong>: Use more threads (“<em>–threads</em>”) for faster processing</li>
190+
<li><strong>For sensitive servers</strong>: Reduce “<em>–max-per-host</em>” to avoid banning</li>
191+
<li><strong>For scheduled validations</strong>: Use “<em>–with-date</em>” for history</li>
192+
<li><strong>For scripting</strong>: Use “<em>–no-color –quiet</em>” for machine-readable output</li>
193+
</ol>
194+
<h2 id="troubleshooting">Troubleshooting <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
195+
<p><strong>Error: “Cannot write file”</strong> - Ensure you have write permissions in the directory</p>
196+
<p><strong>Error: “Unsupported file type”</strong> - Ensure the file has <strong>.csv</strong> or <strong>.m3u</strong> extension</p>
197+
<p><strong>Many non-functional stations</strong> - Check your network connection - Increase “<em>–timeout</em>” for slow servers - Check if stations require specific headers/referrer</p>
198+
<h2 id="contributing">Contributing <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
199+
<p>Any improvements to the validation algorithm or new detection techniques are welcome.</p>
200+
</body>
201+
</html>

0 commit comments

Comments
 (0)