Pyradio - Play your Favorite Radio Station from Linux Terminal

Pyradio is a free and open source Python-based command line tool that allows you to play your favorite radio station online. We'll take you through the installation of Pyradio and how to play your favorite radio station online from Ubuntu Linux terminal. We have tested this installation on Ubuntu 18.04 version.

Prerequisites before installing Pyradio

Before we get started, here are a few things we need to have installed in our Linux system.

  1. Python3
  2. pip3
  3. mplayer or vlc media player

Installation of PyRadio

To install PyRadio clone the git repository

https://github.com/coderholic/pyradio.git

After successful cloning, navigate to pyradio folder

cd pyradio

Use Pyradio to play your favorite radio

Next, we shall install Pyradio by building from source

Building Pyradio from Source

python setup.py build

Next, install the build

python setup.py install

After successful installation, it's time to launch Pyradio and listen to your favorite radio station!

To launch Pyradio, you need to switch from root to a regular user and  run

pyradio --play

Output

Use Pyradio to play your favorite radio

Scroll to your preferred station and Hit Enter to start streaming.

To view, the station list files head to

pyradio/pyradio

In this directory, you'll find the stations.csv file as shown

vim stations.csv

Output

  1 # Find lots more stations at http://www.iheart.com,
  2 Alternative (BAGeL Radio - SomaFM),http://somafm.com/bagel.pls
  3 Alternative (The Alternative Project),http://c9.prod.playlists.ihrhls.com/4447/playlist.m3u8
  4 American Roots (Boot Liquor - SomaFM),http://somafm.com/bootliquor.pls
  5 Celtic (ThistleRadio - SomaFM),http://somafm.com/thistle.pls
  6 Chillout (Groove Salad - SomaFM),http://somafm.com/startstream=groovesalad.pls
  7 Commodore 64 Remixes (Slay Radio),http://www.slayradio.org/tune_in.php/128kbps/listen.m3u
  8 Covers (SomaFM),http://somafm.com/covers.pls
  9 Downtempo (Secret Agent - SomaFM),http://somafm.com/secretagent.pls
 10 Dub Step (Dub Step Beyond - SomaFM),http://somafm.com/dubstep.pls
 11 Electronic/Dance (Electronic Culture),http://www.shouted.fm/tunein/electro-dsl.m3u
 12 Folk (Folk Forward - SomaFM),http://somafm.com/folkfwd.pls
 13 Hip Hop (Hot 97 NYC),http://playerservices.streamtheworld.com/pls/WQHTAAC.pls
 14 Hip Hop (Power 1051 NYC),http://c11.prod.playlists.ihrhls.com/1481/playlist.m3u8
 15 House (Beat Blender - SomaFM),http://somafm.com/startstream=beatblender.pls
 16 Indie Pop (Indie Pop Rocks! - SomaFM),http://somafm.com/indiepop130.pls
 17 Intelligent dance music (Cliq Hop - SomaFM),http://somafm.com/startstream=cliqhop.pls
 18 Jazz (Sonic Universe - SomaFM),http://somafm.com/startstream=sonicuniverse.pls
 19 Lounge (Illinois Street Lounge - SomaFM),http://somafm.com/illstreet.pls
 20 Pop (PopTron! - SomaFM),http://somafm.com/poptron.pls
 21 Pop/Rock/Urban  (Frequence 3 - Paris) ,http://streams.frequence3.net/hd-mp3.m3u
 22 Progressive (Tags Trance Trip - SomaFM),http://somafm.com/tagstrance.pls
 23 Public Radio (WNYC - Public Radio from New York to the World),http://wnyc-iheart.streamguys.com/wnycfm-iheart.aac
 24 Reggae Dancehall (Ragga Kings),http://www.raggakings.net/listen.m3u
 25 Rock (Digitalis - SomaFM),http://somafm.com/digitalis.pls
~                                                                                                                                      
~

To access help man pages run

pyradio -h

Sample Output

usage: pyradio [-h] [--stations STATIONS] [--play [PLAY]] [--add] [--list]

Console radio player

optional arguments:
  -h, --help            show this help message and exit
  --stations STATIONS, -s STATIONS
                        Path on stations csv file.
  --play [PLAY], -p [PLAY]
                        Start and play. The value is num station or empty for
                        random.
  --add, -a             Add station to list.
  --list, -l            List of added stations.

Other Useful controls

Enter - Play the highlighted station
- / +    - Increase / Decrease the volume
    m    - Mute
    r      - Select a random station
    q     -  Quit / End

Read also :

In this article, we outlined how to install and use Pyradio to play your favorite radio station. Pyradio is a handy command-line tool you can use to keep boredom at a bay and inject some excitement by listening to a myriad of worldwide radio stations. It can be installed on many Linux distributions, both Debian and RedHat based. You could also try another version of Pyradio on github but we didn't test it. Give it a shot and give us your feedback. :-)

Resource Reference

GitHub - Pyradio

Jamie Arthur 12:05 am

About Jamie Arthur

Hey, I'm James, a passionate Linux Systems administrator, and a tech enthusiast. I derive immense gratification in conducting research on Linux systems and keeping myself up to date with the latest in the technology world.

Author Archive Page

Have anything to say?

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

All comments are subject to moderation.

2 Comments

    1. We have tested the first link. I have corrected bottom link, sorry for the confusion. It worth trying the second link as well. Let us know how it goes :-)