Skip to content

Commit 7e41359

Browse files
committed
version 0.9.2.21
1 parent 0e484c1 commit 7e41359

File tree

5 files changed

+161
-63
lines changed

5 files changed

+161
-63
lines changed

docs/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,12 +1126,14 @@ <h2 id="installation">Installation <span style="padding-left: 10px;"><sup style=
11261126
<h2 id="command-line-options">Command line options <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
11271127
<pre>$ pyradio -h
11281128

1129+
11291130
Usage: pyradio [-h] [-c CONFIG_DIR] [-p [STATION_NUMBER]] [-u PLAYER] [-a]
11301131
[-l] [-lt] [-sd] [-od] [-d] [-ul] [-us] [-U] [-R] [-V] [-ls]
11311132
[-s PLAYLIST] [-tlp] [-t THEME] [--show-themes] [--no-themes]
11321133
[--write-theme IN_THEME OUT_THEME,] [--terminal TERMINAL]
11331134
[--terminal-param TERMINAL_PARAM] [-oc] [-sc] [-cc] [-gc] [-r]
11341135
[-or] [-lr] [-mkv MKV_FILE] [-scv PNG_FILE] [-srt] [-ach]
1136+
[--headless IP_AND_PORT] [--address] [-fd]
11351137

11361138
Curses based Internet radio player
11371139

@@ -1223,6 +1225,22 @@ <h2 id="command-line-options">Command line options <span style="padding-left: 10
12231225
recorded MKV file. The chapters file will be a SRT
12241226
file, much like the one produced by the previous
12251227
command line parameter.
1228+
1229+
Headless operation:
1230+
--headless IP_AND_PORT
1231+
Start in headless mode. IP_AND_PORT can be a) auto
1232+
(use localhost:11111), b) localhost:XXXXX (access the
1233+
web server through localhost), c) lan:XXXXX (access
1234+
the web server through the LAN) or d) IP_ADDRESS:XXXX
1235+
(the IP_ADDRESS must be already assigned to one of the
1236+
network interfaces). XXXXX can be any port number
1237+
above 1025. Please make sure it is different than the
1238+
one set in the configuration file.
1239+
--address Show remote control server address.
1240+
-fd, --free-dead-headless-server
1241+
Use this if your headless server has terminated
1242+
unexpectedly, and you cannot start a new one (you get
1243+
a message that it is already running).
12261244
</pre>
12271245
<h2 id="controls">Controls <span style="padding-left: 10px;"><sup style="font-size: 50%"><a href="#" title="Go to top of the page">Top</a></sup></span></h2>
12281246
<pre> Main window Playlists window Themes window

docs/index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,14 @@ In any other case, and since **PyRadio** is currently not available via pip, you
120120
```
121121
$ pyradio -h
122122
123+
123124
Usage: pyradio [-h] [-c CONFIG_DIR] [-p [STATION_NUMBER]] [-u PLAYER] [-a]
124125
[-l] [-lt] [-sd] [-od] [-d] [-ul] [-us] [-U] [-R] [-V] [-ls]
125126
[-s PLAYLIST] [-tlp] [-t THEME] [--show-themes] [--no-themes]
126127
[--write-theme IN_THEME OUT_THEME,] [--terminal TERMINAL]
127128
[--terminal-param TERMINAL_PARAM] [-oc] [-sc] [-cc] [-gc] [-r]
128129
[-or] [-lr] [-mkv MKV_FILE] [-scv PNG_FILE] [-srt] [-ach]
130+
[--headless IP_AND_PORT] [--address] [-fd]
129131
130132
Curses based Internet radio player
131133
@@ -218,6 +220,22 @@ Recording stations:
218220
file, much like the one produced by the previous
219221
command line parameter.
220222
223+
Headless operation:
224+
--headless IP_AND_PORT
225+
Start in headless mode. IP_AND_PORT can be a) auto
226+
(use localhost:11111), b) localhost:XXXXX (access the
227+
web server through localhost), c) lan:XXXXX (access
228+
the web server through the LAN) or d) IP_ADDRESS:XXXX
229+
(the IP_ADDRESS must be already assigned to one of the
230+
network interfaces). XXXXX can be any port number
231+
above 1025. Please make sure it is different than the
232+
one set in the configuration file.
233+
--address Show remote control server address.
234+
-fd, --free-dead-headless-server
235+
Use this if your headless server has terminated
236+
unexpectedly, and you cannot start a new one (you get
237+
a message that it is already running).
238+
221239
```
222240

223241
## Controls

docs/pyradio.1

Lines changed: 123 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -21,74 +21,136 @@ It currently supports the following players: \fIMPV\fR, \fIMPlayer\fR and \fIVLC
2121

2222
.SH Options
2323

24-
.IP \fB-c\fR\ [\fICONFIG\fR],\ \fB\ \--config-dir\ \fR[\fICONFIG\fR]
25-
Use specified configuration directory instead of the default one. \fBpyradio\fR will try to create it, if it does not exist. Not available on Windows.
26-
.IP \fB-s\fR,\fB\ \--stations\ \fR[\fISTATIONS\fR]
27-
Use specified station CSV file.
28-
.IP \fB-p\fR,\fB\ \--play\ \fR\<\fIPLAY\fR\>
29-
Play station number \fR\<\fIPLAY\fR\>. Select randome station if \fR\<\fIPLAY\fR\> not specified.
30-
.IP \fB-u\fR,\fB\ \--use-player\ \fR[\fIUSE_PLAYER\fR]
31-
Specify which player to use (\fImpv\fR,\ \fImplayer\fR\ or\ \fIvlc\fR). A comma-separated list of players can be givven, thus specifying detection order.
32-
.IP \fB-a\fR,\fB\ \--add
24+
.PP
25+
\fIGeneral options:\fR
26+
.IP\ \fB-c\fR\ \fICONFIG_DIR\fR,\ \fB--config\fR\fB-dir\fR\ \fICONFIG_DIR\fR
27+
Use specified configuration directory instead of the
28+
default one. PyRadio will try to create it, if it does
29+
not exist. Not available on Windows.
30+
.IP\ \fB-p\fR\ [\fISTATION_NUMBER\fR],\ \fB--play\fR\ [\fISTATION_NUMBER\fR]
31+
Start and play. The value is num station or empty for
32+
random.
33+
.IP\ \fB-u\fR\ \fIPLAYER\fR,\ \fB--use\fR\fB-player\fR\ \fIPLAYER\fR
34+
Use specified player. A comma-separated list can be
35+
used to specify detection order. Supported players:
36+
\fImpv\fR, \fImplayer\fR, \fIvlc\fR.
37+
.IP\ \fB-a\fR,\ \fB--add\fR
3338
Add station to list.
34-
.IP \fB-ls\fR,\fB\ \--list-playlists
35-
List of available playlists in config dir.
36-
.IP \fB-l\fR,\fB\ \--list
39+
.IP\ \fB-l\fR,\ \fB--list\fR
3740
List of available stations in a playlist.
38-
.IP \fB-t\fR\ \fITHEME\fR,\ \fB--theme\fR\ \fITHEME\fR
39-
Use specified \fITHEME\fR.
40-
.IP \fB--show-themes\fR
41-
Show \fIInternal\fR and \fISystem Themes\fR names.
42-
.IP \fB--no-themes\fR
43-
Disable themes (use default theme).
44-
.IP \fB--write-theme\ \fIIN_THEME\ OUT_THEME\fR
45-
Write an \fIInternal\fR or \fISystem Theme\fR to themes directory.
46-
.IP \fB--terminal\ \fITERMINAL\fR
47-
Use this terminal for Desktop file instead of the auto-detected one. Use "none" to reset to the default terminal, or "\fIauto\fR" to reset to the auto-detected one.
48-
.IP \fB--terminal-param\ \fITERMINAL_PARAM\fR
49-
Use this as \fBpyradio\fR parameter in the Desktop File. Please replace hyphens with underscores when passing the parameter, for example: \fI--terminal-param\fR "\fB_p 3 _t light\fR" (which will result to "\fIpyradio \fB-p 3 -t light\fR").
50-
.IP \fB-tlp\fR,\ \fB--toggle-load-last-playlist
41+
.IP\ \fB-lt\fR,\ \fB--log\fR\fB-titles\fR
42+
Log titles to file.
43+
.IP\ \fB-sd\fR,\ \fB--show\fR\fB-config\fR\fB-dir\fR
44+
Print config directory [\fICONFIG\fR \fIDIR\fR] location and exit.
45+
.IP\ \fB-od\fR,\ \fB--open\fR\fB-config\fR\fB-dir\fR
46+
Open config directory [\fICONFIG\fR \fIDIR\fR] with default file
47+
manager.
48+
.IP\ \fB-d\fR,\ \fB--debug\fR
49+
Start PyRadio in debug mode.
50+
.IP\ \fB-ul\fR,\ \fB--unlock\fR
51+
Remove sessions' lock file.
52+
.IP\ \fB-us\fR,\ \fB--update\fR\fB-stations\fR
53+
54+
Update "\fIstations.csv\fR" (if needed).
55+
.IP\ \fB-U\fR,\ \fB--update\fR
56+
Update PyRadio.
57+
.IP\ \fB-R\fR,\ \fB--uninstall\fR
58+
Uninstall PyRadio.
59+
.IP\ \fB-V\fR,\ \fB--version\fR
60+
Display version information.
61+
62+
.PP
63+
\fIPlaylist selection:\fR
64+
.IP\ \fB-ls\fR,\ \fB--list\fR\fB-playlists\fR
65+
List of available playlists in config dir.
66+
.IP\ \fB-s\fR\ \fIPLAYLIST\fR,\ \fB--stations\fR\ \fIPLAYLIST\fR
67+
Load the specified playlist instead of the default
68+
one.
69+
.IP\ \fB-tlp\fR,\ \fB--toggle\fR\fB-load\fR\fB-last\fR\fB-playlist\fR
5170
Toggle autoload last opened playlist.
52-
.IP \fB-sd\fR,\fB--show-config-dir\fR
53-
Print config directory (\fI[CONFIG DIR]\fR) location and exit.
54-
.IP \fB-od\fR,\fB--open-config-dir\fR
55-
Open config directory (\fI[CONFIG DIR]\fR) with default file manager.
56-
.IP \fB-or\fR,\fB--open-recordings\fR
57-
Open the Recordings folder.
58-
.IP \fB-oc\fR,\ \fB--open-cache\fR
71+
72+
.PP
73+
\fIThemes:\fR
74+
.IP\ \fB-t\fR\ \fITHEME\fR,\ \fB--theme\fR\ \fITHEME\fR
75+
Use specified theme.
76+
.IP\ \fB--show\fR\fB-themes\fR
77+
Show Internal and System Themes names.
78+
.IP\ \fB--no\fR\fB-themes\fR
79+
Disable themes (use default theme).
80+
.IP\ \fB--write\fR\fB-theme\fR\ \fIIN_THEME\fR\ \fIOUT_THEME\fR,
81+
Write an Internal or System Theme to themes directory.
82+
83+
.PP
84+
\fITerminal selection:\fR
85+
.IP\ \fB--terminal\fR\ \fITERMINAL\fR
86+
Use this terminal for Desktop file instead of the
87+
auto-detected one. Use "\fInone\fR" to reset to the default
88+
terminal or "\fIauto\fR" to reset to the auto-detected one.
89+
.IP\ \fB--terminal-param\fR\ \fITERMINAL_PARAM\fR
90+
Use this as PyRadio parameter in the Desktop File.
91+
Please replace hyphens with underscores when passing
92+
the parameter, for example: \fB--terminal-param\fR \fI"_p 3 _t
93+
light"\fR (which will result to "\fBpyradio \fI-p 3 -t light\fR").
94+
95+
.PP
96+
\fICache:\fR
97+
.IP\ \fB-oc\fR,\ \fB--open\fR\fB-cache\fR
5998
Open the Cache folder.
60-
.IP \fB-sc\fR,\ \fB--show-cache\fR
99+
.IP\ \fB-sc\fR,\ \fB--show\fR\fB-cache\fR
61100
Show Cache contents.
62-
.IP \fB-cc\fR,\ \fB--clear-cache\fR
101+
.IP\ \fB-cc\fR,\ \fB--clear\fR\fB-cache\fR
63102
Clear Cache contents.
64-
.IP \fB-gc\fR,\ \fB--get-cache\fR
103+
.IP\ \fB-gc\fR,\ \fB--get\fR\fB-cache\fR
65104
Download source code, keep it in the cache and exit.
66-
.IP \fB-us\fR,\ \fB--update_stations
67-
Update "\fIstations.csv\fR" (if needed).
68-
.IP \fB-lt\fR,\ \fB--log-titles\fR
69-
Log titles to file.
70-
.IP \fB-r\fR,\ \fB--record\fR
71-
Turn recording on (not available for VLC player on Windows).
72-
.IP \fB-mkv\ \fIMKV_FILE\fR,\ \fB--mkv-file\ \fIMKV_FILE
73-
Specify a previously recorded MKV file to be used with one of the following options. The \fIMKV_FILE\fR can either be an absolute or a relative path, or a number provided by the \fB-lr\fR command line paremater. If it is a relative path, it should be found in the current or in the Recordings directory.
74-
.IP \fB-scv\fR\ \fIPNG_FILE\fR,\ \fB--set-mkv-cover\ \fIPNG_FILE
75-
Add or change the cover image of a previously recorded \fBMKV\fR file. \fIPNG_FILE\fR can either be an absolute or a relative path. If relative, it should be found in the current or in the Recordings directory.
76-
.IP \fB-srt\fR,\ \fB--export-srt
77-
Export a previously recorded \fBMKV\fR file chapters to an \fISRT\fR file. The file produced will have the name of the input file with the "\fImkv\fR" extension replaced by "\fIsrt\fR".
78-
.IP \fB-ach\fR,\ \fB--add-chapters
79-
Add (or replace) chapter markers to a previously recorded \fBMKV\fR file. The chapters file will be a \fISRT\fR file, much like the one produced by the previous command line parameter.
80-
.IP \fB-d\fR,\fB\ \--debug
81-
Enable \fBDEBUG MODE\fR.
82-
.IP \fB-ul\fR,\ \fB--unlock\fR
83-
Remove sessions' lock file.
84-
.IP \fB-U\fR,\ \fB--update\fR
85-
Update \fBpyradio\fR.
86-
.IP \fB-R\fR,\ \fB--uninstall\fR
87-
Uninstall \fBpyradio\fR.
88-
.IP \fB-V\fR,\fB\ \--version\fR
89-
Display version information.
90-
.IP \fB-h\fR,\fB\ \--help
91-
Display usage information and exit.
105+
106+
.PP
107+
\fIRecording stations:\fR
108+
.IP\ \fB-r\fR,\ \fB--record\fR
109+
Turn recording on (not available for \fIVLC\fR player on
110+
Windows).
111+
.IP\ \fB-or\fR,\ \fB--open\fR\fB-recordings\fR
112+
Open the Recordings folder.
113+
.IP\ \fB-lr\fR,\ \fB--list\fR\fB-recordings\fR
114+
List recorded files.
115+
.IP\ \fB-mkv\fR\ \fIMKV_FILE\fR,\ \fB--mkv\fR\fB-file\fR\ \fIMKV_FILE\fR
116+
Specify a previously recorded \fIMKV\fR file to be used with
117+
one of the following options. The \fIMKV_FILE\fR can either
118+
be an absolute or a relative path, or a number
119+
provided by the \fB-lr\fR command line paremater. If it is a
120+
relative path, it should be found in the current or in
121+
the Recordings directory.
122+
.IP\ \fB-scv\fR\ \fIPNG_FILE\fR,\ \fB--set\fR\fB-mkv\fR\fB-cover\fR\ \fIPNG_FILE\fR
123+
Add or change the cover image of a previously recorded
124+
\fIMKV\fR file. \fIPNG_FILE\fR can either be an absolute or a
125+
relative path. If relative, it should be found in the
126+
current or in the Recordings directory.
127+
.IP\ \fB-srt\fR,\ \fB--export\fR\fB-srt\fR
128+
Export a previously recorded \fIMKV\fR file chapters to an
129+
\fISRT\fR file. The file produced will have the name of the
130+
input file with the "mkv" extension replaced by "srt".
131+
.IP\ \fB-ach\fR,\ \fB--add\fR\fB-chapters\fR
132+
Add (or replace) chapter markers to a previously
133+
recorded \fIMKV\fR file. The chapters file will be a \fISRT\fR
134+
file, much like the one produced by the previous
135+
command line parameter.
136+
137+
.PP
138+
\fIHeadless operation:\fR
139+
.IP\ \fB--headless\fR\ \fIIP_AND_IPORT\fR
140+
Start in headless mode. \fIIP_AND_IPORT\fR can be a) auto
141+
(use \fBlocalhost\fR:\fI11111\fR), b) \fBlocalhost\fR:\fIXXXXX\fR (access the
142+
web server through localhost), c) \fBlan\fR:\fIXXXXX\fR (access
143+
the web server through the \fILAN\fR) or d) \fBIP_ADDRESS\fR:\fIXXXX\fR
144+
(the \fBIP_ADDRESS\fR must be already assigned to one of the
145+
network interfaces). \fIXXXXX\fR can be any port number
146+
above 1025. Please make sure it is different than the
147+
one set in the configuration file.
148+
.IP\ \fB--address\fR
149+
Show remote control server address.
150+
.IP\ \fB-fd\fR,\ \fB--free\fR\fB-dead\fR\fB-headless\fR\fB-server\fR
151+
Use this if your headless server has terminated
152+
unexpectedly, and you cannot start a new one (you get
153+
a message that it is already running).
92154

93155
.RE
94156
.PP

pyradio/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def shell():
335335
else:
336336
gr_headless = parser.add_argument_group('• Headless operation')
337337
gr_headless.add_argument('--headless', default=None, metavar=('IP_AND_PORT', ),
338-
help='Start in headless mode. IP_AND_PORT can be a) auto (use localhost:11111), b) localhost:XXXXX (access the web server through localhost), c) lan:XXXXX (access the web server through the LAN) or d) IP_ADDRESS:XXXX (the IP_ADDRESS must be an assigned to one of the network interfaces). XXXXX can be any port number above 1025. Please make sure it is different than the one set in the configuration file.')
338+
help='Start in headless mode. IP_AND_PORT can be a) auto (use localhost:11111), b) localhost:XXXXX (access the web server through localhost), c) lan:XXXXX (access the web server through the LAN) or d) IP_ADDRESS:XXXX (the IP_ADDRESS must be already assigned to one of the network interfaces). XXXXX can be any port number above 1025. Please make sure it is different than the one set in the configuration file.')
339339
gr_headless.add_argument('--address', action='store_true',
340340
help='Show remote control server address.')
341341
gr_headless.add_argument('-fd', '--free-dead-headless-server', action='store_true',

pyradio/mkvtoolnix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def update_cover(self, print_messages=True):
218218
return None
219219
if not self._cover_file.endswith('.png'):
220220
if print_messages:
221-
print(' File not supported: "{}"'.format(out[1]))
221+
print(' File not supported: "{}"'.format(self._cover_file))
222222
sys.exit(1)
223223
else:
224224
return None

0 commit comments

Comments
 (0)