Monday, 2 May 2011

How to export Rhythmbox radio stations?

Rhythmbox is currently my favorite audio player. I often listen to internet radio stations.

Now I wanted to export the stations which I added to Rhythmbox. Unfortunately you can't do this with Rhythmbox itself. It's possible to export normal playlists, but it's not possible to export your radio stations.

Rhythmbox stores meta information of your media library in an XML file which is located at

You will probably see that most of the elements starts with <entry type="ignore"> or <entry type="song">

The type of internet radio stations is "iradio". E.g.:
<entry type="iradio">
    <title>Radio Swiss Jazz</title>
    <genre>Jazz Music</genre>

What we need is a way to extract all titles and locations of xml entries of type iradio. This can easily done with a XPath query. I use XMLStarlet for this purpose (I like to work in the command line). You can install it with

sudo apt-get install xmlstarlet

Now we have the tool to work with and we know what we are looking for. Here comes the magic:

xmlstarlet sel -t -m "/rhythmdb/entry[@type='iradio']" -v title -n -v location -n ~/.local/share/rhythmbox/rhythmdb.xml

This will give you a list of you stations with their names and addresses. In my case it looks like this:

Rock Antenne
Bremen 1
Radio Swiss Jazz
Radio Stephansdom



Louisville Bully said...

Thank you! I had no clue how to export the radio stations. This worked perfectly.

colan said...

If you want the genres too, you need to add the "genre" field to the query.

xmlstarlet sel -t -m "/rhythmdb/entry[@type='iradio']" -v title -n -v genre -n -v location -n ~/.local/share/rhythmbox/rhythmdb.xml

Avinash Sonawane said...

Wow! This is awesome! Thanks colan! I tested this. It really works.
By the way now can I use this file (I stored the output in a file) obtained to add the radio stations in another Rhythmbox installation. That way I can easily add all of my radio stations (175+) to my friend's Rhythmbox. :)

sztuka kulinarna said...

and how now import this list to other rythmbox ?

sztuka kulinarna said...
This comment has been removed by the author.
Unknown said...

I soon plan to finally upgrade my Ubuntu OS (10.04 to 12.04). Can this report be used to IMPORT the streams in to Rhythmbox on the new OS? If so, how do I do this? Thanks!