Possibility to store Dirble / Tunein radio channels on SD card


We use the musicbox everyday at work, it’s great!

Would it be possible to make a favorite list of radio channels from Dirble and Tune-in?

Would be a great future, as now we have to search for the same radio channels everyday.

If you want to make a favourites list that’s available for all clients you can make a m3u playlist containing your chosen stream URLs and save it in musicbox’s /var/lib/mopidy/playlists directory. Finding the URI for what’s playing has become a little trickier lately but you can see Adding default Radio Streams for one way of doing it.

As an example, I have the following saved in /var/lib/mopidy/playlists/Favourites.m3u

#EXTINF:123, BBC Radio 2 (London)
#EXTINF:0,Absolute Radio (London)

There might be a hacky way to make it appear first in the list of playlists shown by the webclient but I don’t know.

Ok, nice!
I will try this solution. Thank you!

It works! Many thanks!

I’m a Mopidy-newbie but I think I found a way to do this by editing webclient files. The streamuris.js file (located in /opt/webclient/js/streamuris.js) controls the default streamuris which appear in the webinterface under the section “Streams”.
You can open the file via ssh or local and edit it by typing:

nano /opt/webclient/js/streamuris.js

After that you see the default streams e.g.:

var streamUris = [];
//fill with defaults
streamUris.push(['BBC Radio 2 (London)', 'tunein:station:s24940']);
streamUris.push(['3FM Dutch', 'http://icecast.omroep.nl/3fm-bb-mp3']);

By adding under the “var streamUris = [];” you can add your own tunein stations:

var streamUris = [];
streamUris.push(['BBC Radio 2 (London)', 'tunein:station:s24940']);

The syntax is:
streamUris.push([‘YOUR NAME FOR THE STATION’, ‘tunein:station:STATIONNUMBER’]);

After saving and rebooting the station is shown under “Streams” in the webinterface.


The problem with doing it this way is you must redo it every time you (re)write the SD card and you are a bit reliant on this JS mechanism saying the same between releases. But it does up in a more logical place in the interface, which is nicer. Ideally a mix of both solutions would be nice i.e. A particular local playlist is used as the stream pre-sets/favourites similar to Mpdroid (and, I think, cantata).

Thank you for another solution that sounds great!
I will try and test it as soon as I can!

It’s exactly what I’m doing :smile:
I’m writing a small webservice using the Tornado web server extension.
This service (after a small update on the web interface) will save and load the streamlist in a SQLite DB.
I’ll sure publish my code.


Have you considered updating the existing Webclient to implement this
functionality with a local playlist accused through the existing core
playlist controller API? It would be really nice to be compatible with
Mpdroid (and others) rather than reinvent another mechanism. Plus it should
be much simpler.

Well that could be an idea. But I’d prefer to give the opportunity to the users to have a playlist on the server that can be accessed from more any device.
What do you think about it?

Ok… sorry… forget my last message.
Didn’t see some of the API calls. :smile:
Using API is the right way.

If you are still interested in working on it then please submit a PR to the mopidy-musicbox-webclient project and hopefully @woutervanwijk can include it in the next release. If you call the local playlist ‘[Radio Streams]’ then it’s also compatible with Mpdroid/Cantata - bonus! (see https://github.com/abarisain/dmix/commit/a51009d4103225d6f7c2bcd516df3eb53966796c).

Yes. I’m still interested I have to play a bit around with API.

sounds good! It’s an idea I wanted to implement, but never got to it

One might as well store direct streams, and not tunin “redirection”: