BBC Radio Stations

Build/modify/repair equipment and improve systems performance by yourself

BBC Radio Stations

Postby aj78 » 30 Oct 2014, 22:05

The BBC has a weird approach to its radio station streams. The stream names change randomly every few hours so you can't just add them to the web radios list and be done with it. So here's a script I put together:

#!/bin/sh
cd /mnt/MPD/Webradio
wget http://www.bbc.co.uk/radio/listen/live/r2_aaclca.pls
mv r2_aaclca.pls BBCRadio2.pls
wget http://www.bbc.co.uk/radio/listen/live/r3_aaclca.pls
mv r3_aaclca.pls BBCRadio3.pls
wget http://www.bbc.co.uk/radio/listen/live/r4_aaclca.pls
mv r4_aaclca.pls BBCRadio4.pls
wget http://www.bbc.co.uk/radio/listen/live/r4x_aaclca.pls
mv r4x_aaclca.pls BBCRadio4Extra.pls
wget http://www.bbc.co.uk/radio/listen/live/r5l_aaclca.pls
mv r5l_aaclca.pls BBCRadio5Live.pls
wget http://www.bbc.co.uk/radio/listen/live/r5lsp_aaclca.pls
mv r5lsp_aaclca.pls BBCRadio5LiveSportsExtra.pls
wget http://www.bbc.co.uk/radio/listen/live/r6_aaclca.pls
mv r6_aaclca.pls BBCRadio6.pls
mpc update

Put this in your crontab so it runs every hour; it will keep the sources up to date. (You'll have to add the Radio 1 link if you want that, I never listen to it so it's not in my script.)
aj78
 
Posts: 51
Joined: 29 Oct 2014, 20:42

Re: BBC Radio Stations

Postby ACX » 31 Oct 2014, 00:51

Hi aj78,
thank for your contribution :) I'm sure it will be useful for many users here.
User avatar
ACX
RuneAudio co-founder
 
Posts: 1687
Joined: 29 Nov 2013, 02:25
Location: Udine, Italy

Re: BBC Radio Stations

Postby kajica » 04 Nov 2014, 21:15

thanks for this

great contribution, are there any other radiostations that can be added to this script, like cbc radio 2?

good work on the script
User avatar
kajica
 
Posts: 22
Joined: 27 Sep 2014, 21:26

Re: BBC Radio Stations

Postby aj78 » 04 Nov 2014, 21:45

I'm glad you like it :) I'm not sure about other radio stations. I haven't had much time to explore lots of internet radio stations, I only came across this quirk of the BBC streams because I don't have a separate tuner any more, but do sometimes listen to some of the BBC stations. I haven't heard of any others that do the same thing, but if anyone comes across others it would be useful to post them here so they can be added to the script. Perhaps it could be incorporated into a future version so users don't have to mess about with scripts and crontabs?
aj78
 
Posts: 51
Joined: 29 Oct 2014, 20:42

Re: BBC Radio Stations

Postby kajica » 05 Nov 2014, 08:05

Hi AJ,

I added the scripts as per your instructions but my radio links didnt update,

im not sure if i did it correctly. i used nano to edit cron.

is that a problem?

i just couldnt seem to be able to get around the file when using just crontab -e

let me know, maybe i did something wrong. im a linux terminal newbie... :(
User avatar
kajica
 
Posts: 22
Joined: 27 Sep 2014, 21:26

Re: BBC Radio Stations

Postby aj78 » 05 Nov 2014, 21:16

Don't try to edit your crontab directly with a text editor - use the command "crontab -e". It will launch a text editor and let you update the file, but on closing it automatically synchronises the changes with cron. Or something like that - I'm not too clear about the details but I remember running into the same problem!

The other thing that may be confusng you is the text editor crontab launches is "vi" which is really not intuitive if you haven't come across it before. When it loads up the crontab, press i to start editing the file (in Insert mode). You can then add that line I mentioned: 0 * * * * /usr/local/bin/bbc.sh
Then you have to press Escape to get out of Insert mode, and then :wq[Enter] to write changes and quit.

Hopefully that will fix your problem. If you need any more pointers, post back here and I'll see if I can help further.
aj78
 
Posts: 51
Joined: 29 Oct 2014, 20:42

Re: BBC Radio Stations

Postby kajica » 06 Nov 2014, 02:49

thanks for clarifying,

vi is really not intuitive at all,

i cant get it to work will try again later, ill look for a video explaining working vi!
User avatar
kajica
 
Posts: 22
Joined: 27 Sep 2014, 21:26

Re: BBC Radio Stations

Postby Stwert » 06 Nov 2014, 15:33

I'd recommend nano as a bit of a more intuitive beginner-friendly command line text editor. Same process, just use the command nano instead of vi.

Edit: Sorry, just realized this about the default editor with crontab, so here is how you can change it: https://bbs.archlinux.org/viewtopic.php?id=82391
Stwert
 
Posts: 42
Joined: 19 Sep 2014, 01:58

Re: BBC Radio Stations

Postby ICLlP » 09 Nov 2014, 10:31

aj78 wrote:Don't try to edit your crontab directly with a text editor - use the command "crontab -e". It will launch a text editor and let you update the file, but on closing it automatically synchronises the changes with cron. Or something like that - I'm not too clear about the details but I remember running into the same problem!

The other thing that may be confusng you is the text editor crontab launches is "vi" which is really not intuitive if you haven't come across it before. When it loads up the crontab, press i to start editing the file (in Insert mode). You can then add that line I mentioned: 0 * * * * /usr/local/bin/bbc.sh
Then you have to press Escape to get out of Insert mode, and then :wq[Enter] to write changes and quit.

Hopefully that will fix your problem. If you need any more pointers, post back here and I'll see if I can help further.

I've tried to follow this, but I'm not getting it right. Can you explain for "dummies"?
ICLlP
 
Posts: 88
Joined: 30 Apr 2014, 07:52

Re: BBC Radio Stations

Postby aj78 » 09 Nov 2014, 20:06

I've posted a step-by-step guide in the thread you started in the Raspberry Pi forum: http://www.runeaudio.com/forum/post3559.html#p3559. Also, the new step-by-step guide includes all the national BBC radio stations (the one above was missing Radio 1, Radio 1 Xtra and the BBC Asian Network). Hopefully this helps you out!
aj78
 
Posts: 51
Joined: 29 Oct 2014, 20:42

support RuneAudio Donate with PayPal

Next

Return to DIY and tweaks

Who is online

Users browsing this forum: No registered users and 0 guests