– A CLI frontend to Online Radio is a command-line frontend for mplayer designed to make listening to online radio easy.


  • Allows you to easily play your favorite online radio stations.
  • Adding new stations to is very simple.
  • Record radio streams.
  • Sleep and Wake-Up features.
  • Search Tune-In for new stations.

Download and Install is available via pip:

# pip install radiopy

The latest development version can be found in the SourceForge project page.


Invoking is just as easy as specifying the station name. Classic FM

You can view the list of supported stations by adding the --list flag. --list

This will show a nicely formatted list of the station along with their homepage, so you can easily learn what type of music (or shows) each broadcasts.

Other Options

When invoking you can use the --wake-up and --sleep to make start to play after specified number of minutes and shut itself down after specified number of minutes accordingly. --wake-up 30 Radio Paradise --sleep 60 Radio Tel Aviv

These options can also be used together and make some kind of radio alarm clock. --wake-up 480 --sleep 10 Galgalatz

will play cause to start play for 10 minutes in 8 hours from now. also supports recording streams to mp3 (via lame). --record news.mp3 BBC World Service

This option can also be combined with the --sleep and --wake-up flags to time the recording.

28 thoughts on “ – A CLI frontend to Online Radio

  1. Simon

    This is just great – I’ve been struggling with a pile of mplayer stream url’s for BBC radio, that stopped working some time ago, and this has replaced all of the messing about entirely.

  2. Pingback: SOURCES.LIST » Blog Archive » Tante gui per Mplayer

  3. Pingback: Sveriges radio nya hemsida? Flash spelare tappar ljudet.

  4. Richard

    Unfortunately it looks as if the BBC streams have been changed, and no longer work… Other than that, great program…

  5. Cesar rodriguez

    It is a very nice project, Thank you, but somo statios don’t work any more: BBC, radioio, and probably others

  6. Chris

    The above folks are correct. Lots of the stations in the main don’t work. I ended up commenting them all out. Then I used the ~/.radiopy config file to add my own personal streams.

    Great wrapper for mplayer. Thanks a bunch!

  7. Parménides GV


    I love this project, but I’d like to see it in Debian.

    What about packaging it? Have you thought about it?

  8. Guy Post author

    It’s a great idea, but I never had the time to package it. I think the best thing would be to actually package it for PyPi so it would be available via tools like pip instead of directly through Debian.

    However, if you are willing to create a package for Debian, I’ll gladly upload it to the page.

  9. banshee

    This program looks like just what I am looking for! Unfortunately having issues invoking to play stations. For instance, following the example with listed stations, I am recieving this error:
    banshee@nachtcrawler:~$ Rocky FM
    Traceback (most recent call last):
    File “/usr/local/bin/”, line 96, in
    File “/usr/local/bin/”, line 91, in main, **player_options)
    File “/usr/local/lib/python2.7/dist-packages/radiopy/”, line 96, in play
    File “/usr/lib/python2.7/”, line 344, in execvp
    _execvpe(file, args)
    File “/usr/lib/python2.7/”, line 380, in _execvpe
    func(fullname, *argrest)
    OSError: [Errno 2] No such file or directory

    This error seems to occur when I try to start any radio station listed ( –list)

    Do you have any thoughts why this error may be occuring? I am new to linux and python X| but i am trying to learn more and seems very cool. Any direction would be much appreciated!

  10. merijn

    cool! thanks to the error report (by banshee) i managed to find a file to add/edit radio-stations! (radiopy.default) now listening to WFMU! are there more ways to achieve this? i couldn’t find that “~/.radiopy config file” (mentioned by chris)

  11. Tom

    Hi, I am packaging version 0.6 for arch linux AUR. However I noticed that tune-in stations only work if I change station[“playlist”] = “yes” to station[“playlist”] = “no” in This is consistent with when I run mplayer manually, the -playlist argument does not work with tune-in streams. Any comments? Can you maybe change that in an upcoming version?

  12. Kostek

    Hi there, i have the same problem as banshee. I’m totally new at python, i’m working on Win7. My python ver is 2.7
    So I have installed mplayer7.0, I have installed radiopy. And I have that problem

    import mplayer
    import radiopy
    c = radiopy.Player()“Rocky FM”)
    Traceback (most recent call last):
    File “”, line 1, in
    File “build\bdist.win32\egg\radiopy__init_
    File “C:\Python27\lib\”, line 346, in
    _execvpe(file, args)
    File “C:\Python27\lib\”, line 382, in
    func(fullname, *argrest)
    OSError: [Errno 2] No such file or directory

    Any ideas?

  13. Nathan Cheever

    I’m able to record to .wav or .mp3 file formats, but I’m not sure about the bitrates of these files. A project I’m doing requires them to be 16 bits per sample. Is there anyway to customize this?

  14. Guy Post author

    The bitrate is the same as the original stream, there is no conversion. The bitrate of the compression is not the same as how many bits per sample, bits per sample are usually relevant to non-compressed streams (wav, pcm) and lossless.

  15. Tony Fontoura

    Why it doesn’t find any radios? -v -v -v -v bbc
    INFO:Verbosity: Level -10
    DEBUG:tunein: Searching for: bbc
    DEBUG:tunein: No matching station
    radiopy couldn’t find the requested station “bbc”
    Try –list to see the available stations list

  16. Piotr

    Fails to install on Win 10 x64 with the following error:

    pip install radiopy
    Collecting radiopy
    Downloading radiopy-0.6.tar.gz
    Complete output from command python egg_info:
    Traceback (most recent call last):
    File “”, line 1, in
    File “C:\Users\user\AppData\Local\Temp\pip-build-fp_7pckz\radiopy\”, line 23, in
    File “C:\Users\user\AppData\Local\Temp\pip-build-fp_7pckz\radiopy\”, line 19, in get_version
    return version
    NameError: name ‘version‘ is not defined


    Command “python egg_info” failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip-build-fp_7pckz\radiopy\

    Can anything be done to resolve it?

  17. tuk0z

    Runs fine on a Raspberry 3 with Rapsbian (Jessie) or actually OpenMediaVault 3.2 🙂 This after adding working stations in

    Nice job! Next steps should be

    See if I can have my raspberry plays it through a BT-connected speaker
    Give moc and mpd/mpc a try (the latter is said to be easily controlled via some Android app)

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.