You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- mpv will parse "artist" field in addition to "title"
- updating the help/commands output for text based remote control server
- most text based remote control server will return "/title"
- commenting scheduler related code in main.py
- the message to indicate failure to connect to RadioBrowser will be
displayed for 2 seconds
- updating docs
<p>“<strong>Screen</strong> is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells)… Programs continue to run when their window is currently not visible and even when the whole screen session <strong>is detached from the user’s terminal</strong>.”</p>
73
73
<p><strong>PyRadio</strong> users <atarget="_blank" href="https://github.com/Wikinaut">Wikinaut</a> and <atarget="_blank" href="https://github.com/aleksandr-sabitov">aleksandr-sabitov</a> on <atarget="_blank" href="https://github.com/coderholic/pyradio/issues/184">github</a> have come up with the idea to use this approach to run the application on their headless Raspberry Pi, so kudos to them!</p>
74
74
<h3id="usage">Usage</h3>
75
-
<p>After the program is started, the only way (well, not really, more on this below) to interact with it is through its integrated web server.</p>
75
+
<p>After the program is started, the only way to interact with it is through its integrated web server. Please refref to the relevant document for more info on the <ahref="server.html">remote control server</a>.</p>
76
76
<p>The web server can be accessed either through a terminal (address <strong>http://ip:port</strong>) using wget or curl, or through a web browser (address <strong>http://ip:port/html</strong>).</p>
77
77
<p>The ip and port will be set using the <strong>–headless</strong> command line option.</p>
Copy file name to clipboardExpand all lines: docs/headless.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ Now, **PyRadio** is a **terminal application**; it actually **needs** a terminal
37
37
38
38
### Usage
39
39
40
-
After the program is started, the only way (well, not really, more on this below) to interact with it is through its integrated web server.
40
+
After the program is started, the only way to interact with it is through its integrated web server. Please refref to the relevant document for more info on the [remote control server](server.md).
41
41
42
42
The web server can be accessed either through a terminal (address **http://ip:port**) using `wget` or `curl`, or through a web browser (address **http://ip:port/html**).
<h2id="remote-control-server">Remote Control Server <spanstyle="padding-left: 10px;"><supstyle="font-size: 50%"><ahref="#" title="Go to top of the page">Top</a></sup></span></h2>
1865
1865
<p><strong>PyRadio</strong> can be controlled remotely using normal http requests either form the command line (with <em>curl</em> for example) or from a browser.</p>
1866
1866
<p>For more information, please refer to <ahref="server.html">the relevant page</a>.</p>
1867
+
<p>If you’d like to set up a “headless” <strong>PyRadio</strong> operation for your linux box, please refer to the <ahref="headless.html">Headless</a> page.</p>
1867
1868
<h2id="debug-mode">Debug mode <spanstyle="padding-left: 10px;"><supstyle="font-size: 50%"><ahref="#" title="Go to top of the page">Top</a></sup></span></h2>
1868
1869
<p>Adding the “<strong>-d</strong>” option to the command line will instruct <strong>PyRadio</strong> to enter <em>Debug mode</em>, which means that it will print debug messages to a file. This file will always reside in the user’s home directory and will be named <em>pyradio.log</em>.</p>
1869
1870
<p>In case of a bug or a glitch, please include this file to the issue you will <atarget="_blank" href="https://github.com/coderholic/pyradio/issues">open at github</a>.</p>
Copy file name to clipboardExpand all lines: docs/index.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1080,6 +1080,8 @@ If so, a notification message will be displayed, informing the user about it and
1080
1080
1081
1081
For more information, please refer to [the relevant page](server.md).
1082
1082
1083
+
If you'd like to set up a "headless" **PyRadio** operation for your linux box, please refer to the [Headless](headless.md) page.
1084
+
1083
1085
## Debug mode
1084
1086
1085
1087
Adding the "**-d**" option to the command line will instruct **PyRadio** to enter *Debug mode*, which means that it will print debug messages to a file. This file will always reside in the user's home directory and will be named *pyradio.log*.
<li><ahref="#using-the-text-server">Using the Text Server</a></li>
50
53
<li><ahref="#examples">Examples</a></li>
51
54
<li><ahref="#text-vs.-web-commands">Text vs. Web commands</a></li>
@@ -81,40 +84,86 @@ <h3 id="using-the-web-server">Using the Web Server</h3>
81
84
<p>The idea is that while <strong>PyRadio</strong> is running on the PC, people relaxing on the sofa, chilling with friends, listening to music from their favorite radio station, being able to increase / decrease the volume, change stations, etc. using their phones.</p>
82
85
<p>The available commands are “encoded” in the buttons shown on the screen; the right part of the image shows the output of the “<strong>Stations List</strong>” button. To start a station, I would just click (well, tap) on its name, and viola!</p>
83
86
<p>The <strong>Web</strong> interface will also show the song’s title, if availabe, or the name of the station that’s playing, if it’s not. In order to achieve this functionality, <em>javascript</em> is heavily used, so one should keep that in mind (in case <em>javascript</em> has been disabled in the browser, for example).</p>
84
-
<h3id="using-the-text-server">Using the Text Server</h3>
<p>The buttons shown in the web interface are:</p>
89
+
<ul>
90
+
<li><p><strong>Local Playlist</strong><br/>
91
+
This button will permit the user to toggle between opening a local playlist (default state) and a <strong>Radio Browser</strong> “playlist”, actually a search result set of players.</p></li>
92
+
<li><p><strong>Play Next</strong> and <strong>Play Previous</strong><br/>
93
+
The buttons title says it all…<br/>
94
+
Subsequent clicks on a button will only be accepted after the player has “settled”, i.e. either started playing or failed to connect to the station.</p></li>
95
+
<li><p><strong>Play Hist. Next</strong> and <strong>Play Hist. Previous</strong><br/>
96
+
Same as above, but stations will come from the “<strong>station history</strong>” instead of the current playlist.</p></li>
97
+
<li><p><strong>Toggle Playback</strong><br/>
98
+
Nothing more to say here; start/stop the player.</p></li>
99
+
<li><p><strong>Volume Up</strong> and <strong>Volume Down</strong>, <strong>Save Volume</strong>, <strong>Mute Player</strong><br/>
100
+
These are the volume adjustment, saving and muting the player functions.</p></li>
101
+
<li><p><strong>Show Stations</strong><br/>
102
+
Clicking this buttons will present the list of stations in the current playlist (or search result). Clicking on a station name will start its playback.</p></li>
103
+
<li><p><strong>Show Groups</strong><br/>
104
+
This will display, and permit the selection of the groups defined within a playlist. When a group name is selected, the list of players will be opened and scrolled to the beginning of the group.</p></li>
105
+
<li><p><strong>Show Playlists</strong><br/>
106
+
This will show a list of the playlists already composed by the user. Clicking on a playlist’s name will open the playlist; the stations will be available through the <strong>Show Stations</strong>.<br/>
107
+
<br/>
108
+
When <strong>Radio Broeser</strong> is active, the button’s label will change to <strong>Show Searches</strong>. When clicked, the list of existing search items will be presented to the user; clicking on an item will preform the search and results can be displayed by clicking on the <strong>Show Stations</strong> button.<br/>
109
+
<br/>
110
+
No new items can be inserted using the web interface.</p></li>
111
+
<li><p><strong>Enable Title Log</strong><br/>
112
+
This will enable or disable the titles logging function.</p></li>
113
+
<li><p><strong>Like Title</strong><br/>
114
+
This will “like” the current (song).</p></li>
115
+
<li><p><strong>System Info</strong><br/>
116
+
This will display useful info about <strong>PyRadio</strong>. ### Using the Text Server</p></li>
117
+
</ul>
85
118
<p>Why having the <strong>Text</strong> interface as well, one might ask…</p>
86
119
<p>Well, first of all it’s lighter, then one can use it to locally control <strong>PyRadio</strong> from a script and provide a way to adjust the volume for example, using some assigned shortcut key combination.</p>
87
120
<p>Inserting the <strong>Text</strong> address on a terminal using <em>curl</em> or <em>wget</em> or any similar software:</p>
/playlists/x /pl/x get stations list from playlist id x
154
+
(x comes from command /pl)
155
+
/playlists/x,y /pl/x,y play station id y from playlist id x
156
+
/stations /st get stations list from current playlist
157
+
/stations/x /st/x play station id x from current playlist
158
+
/next /n play next station
159
+
/previous /p play previous station
160
+
/histnext /hn play next station from history
161
+
/histprev /hp play previous station from history
162
+
/open_radio_browser /orb open Radio Browser
163
+
/close_radio_browser /crb close Radio Browser
164
+
/list_radio_browser /lrb list Radio Browser search items
165
+
/search_radio_browser/x /srb/x execute search item x
166
+
(x comes from /lrb)</pre>
118
167
<p>The “<strong>Restricted Commands</strong>” will not work in <strong>Playlist mode</strong>; the “<strong>Global Commands</strong>” will work everywhere.</p>
119
168
<h3id="examples">Examples</h3>
120
169
<p>The following commands will increase / decrease the volume and mute the player:</p>
<p>so that in order to start playing station No 20, for example, one would just use the command:</p>
141
190
<pre>$ curl http://192.168.122.4:9998/st/20</pre>
191
+
<p>The following command will get the current song title:</p>
192
+
<pre>$ curl http://192.168.122.4:9998/title
193
+
194
+
retry: 150
195
+
event: /html/title
196
+
data: <b>The Carpenters - No Place Like Home For The Holidays</b>
197
+
</pre>
198
+
<p>The <strong>data</strong> field will contain the HTML format of the title, which is easy to parse in a script.</p>
199
+
<p>If the player is idle, the output will be</p>
200
+
<pre>$ curl http://127.0.0.1:9998/title
201
+
retry: 150
202
+
event: /html/title
203
+
data: <b>Player is stopped!</b></pre>
204
+
<p>Several commands (such as <strong>/v</strong>, <strong>/vu</strong>, <strong>/vd</strong>, etc.) will return this info; this is a side effect of the way the server works, but provides useful info for the script issuing the command.</p>
205
+
<p>One thing that should be made clear is that getting the above info does not mean that the command has succeeded; for example issuing the <strong>/orc</strong> (<strong>/open-radio-browser</strong>) command, will return the above info, but to make sure about the state of <strong>PyRadio</strong>, one should issue the <strong>/i</strong> (<strong>/info</strong>) command:</p>
206
+
<pre>$ curl http://127.0.0.1:9998/i
207
+
208
+
PyRadio 0.9.2.20
209
+
Player: mpv
210
+
Service: RadioBrowser (Austria)
211
+
Status: In playback
212
+
Station (id=5): "Classical Christmas FM"
<h3id="text-vs.-web-commands">Text vs. Web commands</h3>
143
215
<p>On first glance, the difference between a <strong>Text</strong> and a <strong>Web</strong> command is the <em>/html</em> part that exists in the later.</p>
144
216
<p>But things are actually more complex that that.</p>
0 commit comments