Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it any way to import/export Radio Station list of Rhythmbox?

If not, could you please suggest me any good music player which has similar functionality like Rhythmbox?

Thank you!

share|improve this question
You mean radio stations? – Javier Gonzalez Jan 14 '11 at 20:35
Yes, I mean radio stations – Bakhtiyor Jan 17 '11 at 11:01

rhythmbox stores information about all music-files in ~/.local/share/rhythmbox/rhythmdb.xml

Entries concerning radiostations start with "entry type iradio".

share|improve this answer
Yeah you are right, I knew that before. But I am looking for some easier way, if one exists. – Bakhtiyor Jan 15 '11 at 11:56

here's a python script to do the same thing, i.e. extract names and locations of internet radio stations from the xml data base used by Rhythmbox:

import xml.sax.handler
import xml.sax
import pprint

class RhythmboxPlaylistHandler(xml.sax.handler.ContentHandler):
    def __init__(self):
        self.inRTitle = False
        self.inRLocation = False
        self.entrytype = "undefined"
        self.titlebuffer = ""
        self.locationbuffer = ""
        self.radiostations = {}

    def startElement(self, name, attributes):
        if name == "entry":
            self.entrytype = attributes["type"]  # we're interested in type="iradio"
        elif name == "title" and self.entrytype == "iradio":
            self.inRTitle = True
        elif name == "location" and self.entrytype == "iradio":
            self.inRLocation = True

    def characters(self, data):
        if self.inRTitle:
            self.titlebuffer += data
        elif self.inRLocation:
            self.locationbuffer += data

    def endElement(self, name):
        if name == "title":
            self.inRTitle = False
        elif name == "location":
            self.inRLocation = False
        elif name == "entry" and self.entrytype == "iradio":
            self.radiostations[self.titlebuffer] = self.locationbuffer

parser = xml.sax.make_parser(  )
handler = RhythmboxPlaylistHandler(  )


rskeys=[key for key in rstations]

ofile.write("#   {0:41}  -->  {1}\r\n".format('radio station name','location'))
for key in rskeys:
    ofile.write("{0:45}  -->  {1}\r\n".format(key,rstations[key]))

(I started with this tutorial on working with XML data bases from within python:

share|improve this answer

You can use xmlstarlet to pull the essential data out of your XML file. See here for details:

share|improve this answer
nice pointing to xmlstarlet tutorial for this – Sabacon Feb 8 '12 at 0:16
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Marco Ceppi Feb 8 '12 at 0:39
Sorry about that. I just edited it to include the main idea. (Thanks for the link. I was worried that reposting other info would be duplicating web data unnecessarily.) – colan Feb 8 '12 at 4:55

for exporting read the file ~/.local/share/rhythmbox/rhythmdb.xml
if you want to import Create a M3U file playlist as:

#EXTINF:-1,Quran - Eman City  Quran & Islam Talk;stream.nsv

#EXTINF:-1,Quran - Radio Quraan;stream.nsv

#EXTINF:-1,Quran - Allahu Akbar Radio;stream.nsv

#EXTINF:-1,Quran - izlam;stream.nsv

#EXTINF:-1,Quran - tafsir Al Sheikh Mohammad Ratib Al Nabulsi & Sheikh Muhammad Mitwalli Al Sharawi;stream.nsv

#EXTINF:-1,Quran - radioislamico;stream.nsv

and open it with rhythmbox

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.