PyRadio - cli internet radio player

Uploaded, thanks @sng :slight_smile:

3 Likes

Hi @napcok

There is a 0.8.9.16 version out; it has no changes related to linux (it is exactly the same as 0.8.9.15)…

You can update only if you want to have the same version as the one in AUR…

Sorry about that, been working on the installation scripts for Windows and macOS and it seems I fix one and break the other :slight_smile:

2 Likes

Hi @sng
No problem I will update it later today.
Thanks for all your work on PyRadio :slight_smile:

3 Likes

PyRadio is command line internet radio player written in Python.
Fantastic program. Did not realize it existed even though I have been using Linux for 23 years

5 Likes

I am very glad you like it! :blush:

3 Likes

Hey sng! I wrote a tiny script to use PyRadio as a radio alarm clock: https://forum.maboxlinux.org/t/radio-alarm-clock-for-pyradio-with-rtcwake-command-bash-script/883

I wanted to say I really love your program. It’s my everyday companion since I started on MaBox and I use it now on my Lubuntu machine as well. So thank you!. Keep up the excellent work!

4 Likes

Finally tried this out today. Is cool.

Is there a way to copy a radio station from the Radio Browser screen to the playlist? I may just need more sleep, but at the moment the command options are too arcane for my old, habituated short-term memory to keep in order from one pane to the next.

I did vote for Ambient Sleeping Pill though, and will happily do so every time it will let me. :slight_smile:

2 Likes

When you’re in the stations browser select the station you want to copy, press ‘y’ and ‘enter’ :arrow_right: copies entry into register. Then go back to your stations list, move to the line under which you want to add the new entry, press ‘p’ (paste) and ‘s’ to save the playlist.
Hope that helps…

5 Likes

By the way @sng, is there an official way to submit proposals for new radio stations for the browser?

2 Likes

@Faehnchen you can submit new station on website → radio-browser.info

Stationlist in Mabox can be also edited from “Sound/radio menu” - right click on sound volume icon in tint2 panel.

6 Likes

Ah ok, thanks! I didn’t know it’s drawn from a web service :smile:. Thought it was hard coded. Then my question is obsolete. Looked it up and turned out that the station is already registered in their vast database. However by testing in Pyradio I couldn’t use the search function in the browser. Is this an issue with lacking mouse support in Terminator? I run pyradio always from the command line and I didn’t bother to use Sakura, because so far I had no functionality issues running Pyradio in Terminator .

2 Likes

Hi @Faehnchen
What do you mean?
Pressing s does not bring up the search window?

2 Likes

It does, but I can’t enter anything in the ‘Search’ field. I’m only able to navigate in this window with tab and arrow keys. Or did I miss something?

1 Like

Navigate here
Mabox_2022-04-14-18-41-1649950869
and press space
You will get this:
Mabox_2022-04-14-18-41-1649950890

Now you have 6 search fields (Name, Tag, Country, State, Language and Codec); navigate with tab and arrows

Then, using down arrow get here
Mabox_2022-04-14-18-41-1649950908

and type a station name (or part of it) to search for

3 Likes

Nice, that works, thank you very much. Didn’t figure that out. I didn’t read the manual and it was not described in ‘?’ or somewhere else.

Oh, and because you’re already here, do you know a method to pipe the info of the currently played music/feature provided by the connected station to a log file? I assume it is obtained in Pyradio from the mpv-stream, but I couldn’t find out how to extract the stream info of a currently playing station.
However, I think it would be a nice feature to have in Pyradio, as I have to run to my machine every 15 minutes to make a note.

2 Likes

No, this is not possible at the moment (not even with debuging turned on), but I suppose it’s not hard to do…
I will make a note about it :slight_smile:

2 Likes

Yes, I tried debugging mode. Would be easy to filter out I guess. I currently used it to try to implement a function in my radio alarm clock script to check for mpv-stream interruptions and make it to automatically try to reconnect. I overslept twice because the stream somehow got interrupted after wakeup despite starting normally. When I use Pyradio by itself that happens occasionally too. For now I implemented a condition to fall back on mpv playing a directory from the harddrive.

By the way, I just checked the manual to be safe: https://github.com/coderholic/pyradio/blob/master/radio-browser.md#station-database-information.
The activation of the checkboxes with space seems missing there. So at least it wasn’t me just beeing dumb :sweat_smile:.

1 Like

I believe this happens due to the player used, station selected and network connectivity (or a combination of them)…

I have tried to detect such a condition, but failed…
The only thing I can detect is player termination; sometimes the player just terminates when something happend to the stream… but not always…

I don’t think that helps you though

:slight_smile:
No, nobody implied anything like that!
I will add the corresponding instruction there, just in case other people fail to realise it, just like you

2 Likes

About the feature to obtain the infos about the music stream, I had an idea aside from mindlessly spaming the log file. I don’t know if it’s feasable, but here is my feature request :smiling_face: :


Current behaviour:

  • At the moment the information about the music stream (music title / name of show or feature) appears in the bottom left corner of the Pyradio window if provided by the radio station’s stream service.

  • It’s not possible to highlight or copy the text. User has to make notes manually (quite distracting).

  • The information is not logged and subsequently only obtainable (if lucky) from the website of the radio station (more cumbersome for the user)


Desired behaviour

  • Add a function to pipe the music info of a single, currently playing track to a “favourites”- or “liked”-list with timestamp and radio station.

  • perhaps add a keybind / “like-button” to invoke this functionality with a single stroke and to show/edit the list in Pyradio or an external editor.

  • The list could be stored in the pyradio configs directory.

  • Alternatively / additionally there could be an automatically generated list of the last heard songs / programs with a limited amount of entries (to not let it grow exorbitantly) to track back one’s own activity.


It would be really cool if that’d be possible since somewhere in the code this info is already extracted to be displayed in Pyradio, so my idea was that it wouldn’t be to hard to do this on command manually and pipe the info to a chosen destination.

Hope that request was not too audacious. If you like I could put it in your ‘Issues’ directory on Github instead. Please keep up the amazing work!

2 Likes

Hi @Faehnchen

I have already started working on it (I like the idea a lot), so here’s what I have come up with (up to now)

You execute pyradio -lt (-lt is --log-titles to enable titles’ logging)

Then you get a file ~/.config/pyradio/pyradio-titles.log with entries like

Apr 15 (Fri) 10:28 | Ennio Morricone - Meglio Stasera (Vocals Miranda Martino) (1964)
Apr 15 (Fri) 10:30 | Keith Mansfield - Young Scene
Apr 15 (Fri) 10:31 | Bob Crewe Generation - Winchester Cathedral
Apr 15 (Fri) 10:34 | Gillian Hills - Cha Cha Stop
Apr 15 (Fri) 10:37 | Martin Denny - Moonlight And Shadows
Apr 15 (Fri) 10:39 | Bernie Green - Ping Pong
Apr 15 (Fri) 10:42 | Leo Addeo - Stumbling

Enabling titles’ logging will probably be a configuration option or a key shortcut, depending on what I find easier to implement :wink:

So here’s how it works: I have used the RotatingFileHandler with maxBytes=50000 and backupCount=5. So according to the documentataion:

So, if you wanto to give it a go, you can download this archive . When you get it:

tar xvzf pyradio.tar.gz
cd pyradio
devel/build_install_pyradio
pyradio -lt

Please make sure you uninstall the official Mabox package brefore installing this archive

sudo pacman -R pyradio
5 Likes