Update: radio.py 0.5 is available.
radio.py is a little script that makes it very easy to listen to radio under Linux (and maybe other OSs too) with mplayer. All you need to do is to call radio.py with the name of the station you want to listen to. For example:
radio.py Radio Paradise
To read more about radio.py go to the first post discussing radio.py.
Here are some of the things that have changed in
radio.py-0.4 compared to the previous release (0.3). On the usability side, I’ve dropped the need to put quotation marks around station names containing spaces. So while in previous version of
radio.py to listen for “Radio Tel Aviv” you had to run
radio.py "Radio Tel Aviv"
In the new version you can just call
radio.py Radio Tel Aviv
This doesn’t seem a big change but it makes it a lot easier to listen to radio stations with spaces in their names, and listening to radio in a user-friendly way is what
radio.py is all about.
Another great feature is the ability to add new stations to
radio.py on a specific user basis or in a system-wide basis via configuration files.
radio.py looks for
~/.radiopy and parse them for new stations or for overriding existing stations. The system-wide
/etc/radiopy.conf/ overrides the default settings in
radio.py itself, and
~/.radiopy can override the system-wide configuration. The syntax for adding new station is
[station name] home: station homepage stream: station's stream location
So if one wants for example to add the BBC3 radio station (although it already in the known station list) one would add the following snippet to
~/.radiopy (or to
/etc/radiopy.conf if one wants to add it system-wide):
[BBC3] home: http://www.bbc.co.uk/radio3 stream: http://www.bbc.co.uk/radio3/ram/r3g2.ram
The credit for the idea to use configuration file and the basic implementation of parsing them using the
ConfigParser module goes to Fernando Rendón.
In addition to the above, I’ve added 24 new radio stations including all of RadioIO stations, Beethoven (classic music), Radio Paradise and Onda Cero (some Spanish radio).
A full list of changes between
radio.py versions is included the the file
CHANGES inside the
radio.py-0.4 tar archive.
You can download
radio.py-0.4 from here.
The installation process remained the same. Just download the tar archive., extract it and copy
radio.py to somewhere in your
PATH, e.g. to
/usr/local/bin. From the command line you can run the following commands from the directory in which you saved the tar archive in order to install the script:
tar -zxvf radiopy-0.4.tar.gz cd radiopy cp radio.py /usr/bin/
Bugs and Suggestions
If you find a bug in the script please leave a comment bellow. If you have any suggestion or a radio station you would like me to add to the default station list, comment bellow, preferably add the station’s stream url.