Playing live BBC radio with MOC

Forums:

After a while of getting irritated that you can't play BBC radio with MOC, I've worked out a quite nice way of doing it. Note this is probably UK specific, no idea if it works abroad.

Turns out there are AAC streams available at URLs like: http://www.bbc.co.uk/radio/listen/live/r6_aaclca.pls MOC is happy playing these playlists, but the links within only last an hour.

Now you can continually download the playlist file, or you could put the following CGI script on a local webserver:-


#!/bin/sh

echo -n "Location: "

curl -s http://www.bbc.co.uk/radio/listen/live/r6_aaclca.pls \
| awk '/^File1/ { gsub(/^File1=/, ""); print }'

echo

The latest MOC (2.5.0-beta1) is happy following the redirects, so I can now have a local radio.m3u playlist which links to the script above, and keep all my favourite radio stations in one playlist.

Hope this proves useful to someone.

Could you expand a little on why you can't listen to BBC radio with MOC? Is the issue you've explained here the whole problem or is there some failure in MOC itself?

Also see node/852 which might offer an alternative.

There's nothing wrong with MOC here at all. MOC's great :) If anything, supporting a "playlist of playlists" might be nice, as most radio stations seem provide a playlist[0] and expect you try one and fall back. I'm not sure this would be a sane feature to implement though.

The timeout isn't as in node/852. If I download the playlist from the URL and start playing, it will keep going indefinitely. However, there is a token within that playlist I've downloaded that means the URLs within are invalid after an hour or so, so I have to fetch a new playlist to restart the stream after stopping.

It's not the end of the world, but slightly irritating.

[0] http://somafm.com/startstream=cliqhop.pls for example

Okay, I understand how it's working from a browser's POV and I'll have to investigate how MOC would handle it. But it's not something I'll be able to look into for a while.