Help creating a WebRadio shortcut for BBC Radio 2 128k feed


Some background first. The BBC has playlist files you can reference via HTTP from their site. They return back a dynamically generated file to a stream hosted by their content delivery network provider. Those returns have long strings of data which are unique to the request and time limited. So for example in foobar2000 in Windows you can initiate file, open, paste a URL like this by file, open in notepad.exe you can see what is returned by the BBC.

I can navigate to the windows compatible share as \volumio\WebRadio with no problem. I can open and edit .pls and .m3u files by using notepad.exe and the command file, open, then the name of the UNC and file.

The issues is that, I create a file in the share ending in .pls with the time limited string returned by the BBC. Like this:

This works but after some time it no longer works.

What I need is a simple method to create a file in the share that enables volumio to open this URL:

I tried creating a .m3u file with but it didn’t work.

Any bright ideas forum friends? Noting if you are out of the UK the stream may not work properly or will return a lower quality stream. Though I would let you know as many of you will not be located in the UK.

Thank you, Craig.

ianm came out with a brilliant solution

see here:

Hi Michelangelo,

I tried the script and method rather brilliantly penned by ianm and after correcting a typo:
radios[“BBC Radio 4 Extra”]="$

Changed to:
radios[“BBC Radio 4 Extra”]=“

It works a treat. Though my objective of making a simple solution for the wife still remains, as I can’t ask her to:
Fire up putty, run the script, then navigate via a browser to the browse tab and find BBC Radio 2 under WEBRADIO.
Additionally, while I think the script is superb it does initiate unnecessary traffic to the BBC to obtain streaming data.
Eventually, the BBC might IP block hosts making lots of such requests for stream data (if it ran every 45 minutes or so).

Prior to using volumio I connected my USB DAC to the front USB port on my 5 year old QNAP NAS and used their Music Station application to stream radio. They do allow users the ability to create a radio favourite by requesting URL. I’ve attached a couple of scree shots.

Please can you consider a method to eliminate periodic requests to the BBC for stations I may not be listening to as described above?
Or can you look to include tunein radio support as they have an extensive directory and allow the input of custom URL’s?
Or finally can you place a button on the interface to initiate ianm’s script on request - this I’m sure the wife could do :slight_smile: ?

Many thanks and I’m really enjoying volumio!

Music Station 2.JPG
Music Station 1.JPG


right now, I am trying to solve this issue, because I would like to listen BBC Radio 1 :slight_smile:

Right now, I am testing this address: … c_radio1_p (that means, just base adress without ?s=blabla&e=bla… etc.), play is running, let`s see in few days :slight_smile:

Repaired script from ianm (sorry for using cat, lame at sed and awk):

declare -A radios
radios["BBC Radio 1"]=""
radios["BBC Radio 2"]=""
radios["BBC Radio 3"]=""
radios["BBC Radio 4"]=""
radios["BBC Radio 4 Extra"]=""
radios["BBC 6 Music"]=""

for k in "${!radios[@]}"
rm -f "$filepath"
echo "#EXTM3U" >> "$filepath"
echo "#EXTINF:-1, BBC - $k" >> "$filepath"
curl -s $pls | grep File1 | sed 's/File1=\(.*\)/\1/' | cut -d "?" -f1 >> "$filepath"

I’d just like to point out that I shouldn’t be credited for the script, I think I did put a link in the original post with the link to where I found it. However it is a nuisance to have to run the script all the time, but I believe that the BBC tokenise the streams to prevent some sort of abuse. I don’t understand why MPD doesn’t process the .pls in the same way as for example VLC.