Poor Developer's BBC Radio Terminal Player

Here there is a list of radio names with web stream addresses and an autocomplete snippet for bash to play streams with your favourite player, mine is mplayer.

Here the snippet for your .bashrc file:

bbc_radio_player() {
    file="$HOME/.radios.md"
    RADIOS=""
    while IFS= read -r line
    do
        # display $line or do somthing with $line
        LINE=${line%%http*}
        if [[ ${LINE//[ ]/_} == $1 ]]
        then
            RADIO=(${line});
            RADIO=${RADIO[-1]};
        fi
    done <"$file"
    mplayer ${RADIO}
}

_list_radios(){
    file="$HOME/.radios.md"
    RADIOS=""
    while IFS= read -r line
    do
        # display $line or do somthing with $line
        LINE=${line%%http*}
        if [[ ! -z ${LINE} ]] && [[ ! ${LINE} == \#* ]]
        then
            RADIOS="$RADIOS ${LINE//[ ]/_}";
        fi
    done <"$file"
    local cur
    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}

    COMPREPLY=($( compgen -W "$RADIOS" -- $cur ) )
}

complete -F _list_radios bbc_radio_player

And this is the list of radios that I’ve found on a web site 1. Save this file as .radios.md in your home directory. If you prefer another path, do not forget modify relevant lines in snippet above.


## Main
BBC Radio 1 http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
BBC Radio 1xtra http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1xtra_mf_p
BBC Radio 2 http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p
BBC Radio 3 http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio3_mf_p
BBC Radio 4FM http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p
BBC Radio 4LW http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4lw_mf_p
BBC Radio 4 Extra http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4extra_mf_p
BBC Radio 5 Live http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio5live_mf_p
BBC Radio 5 Live Sportsball Extra http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio5extra_mf_p
BBC Radio 6 Music http://bbcmedia.ic.llnwd.net/stream/bbcmedia_6music_mf_p
BBC Asian Network http://bbcmedia.ic.llnwd.net/stream/bbcmedia_asianet_mf_p
BBC World Service UK stream http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-eieuk
BBC World Service News stream http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-einws

## Nations and regions
BBC Radio Cymru http://bbcmedia.ic.llnwd.net/stream/bbcmedia_cymru_mf_p
BBC Radio Foyle http://bbcmedia.ic.llnwd.net/stream/bbcmedia_foyle_mf_p
BBC Radio nan Gàidheal http://bbcmedia.ic.llnwd.net/stream/bbcmedia_nangaidheal_mf_p
BBC Radio Scotland http://bbcmedia.ic.llnwd.net/stream/bbcmedia_scotlandfm_mf_p
BBC Radio Ulster http://bbcmedia.ic.llnwd.net/stream/bbcmedia_ulster_mf_p
BBC Radio Wales http://bbcmedia.ic.llnwd.net/stream/bbcmedia_walesmw_mf_p

## Local Radio
BBC Radio Berkshire http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrberk_mf_p
BBC Radio Bristol http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrbris_mf_p
BBC Radio Cambridgeshire http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrcambs_mf_p
BBC Radio Cornwall http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrcorn_mf_p
BBC Coventry & Warwickshire http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrwmcandw_mf_p
BBC Radio Cumbria http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrcumbria_mf_p
BBC Radio Derby http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrderby_mf_p
BBC Radio Devon http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrdevon_mf_p
BBC Essex http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lressex_mf_p
BBC Radio Gloucestershire http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrgloucs_mf_p
BBC Radio Guernsey http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrguern_mf_p
BBC Hereford & Worcester http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrhandw_mf_p
BBC Radio Humberside http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrhumber_mf_p
BBC Radio Jersey http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrjersey_mf_p
BBC Radio Kent http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrkent_mf_p
BBC Radio Lancashire http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrlancs_mf_p
BBC Radio Leeds http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrleeds_mf_p
BBC Radio Leicester http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrleics_mf_p
BBC Radio Lincolnshire http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrlincs_mf_p
BBC Radio London http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrldn_mf_p
BBC Radio Manchester http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrmanc_mf_p
BBC Radio Merseyside http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrmersey_mf_p
BBC Newcastle http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrnewc_mf_p
BBC Radio Norfolk http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrnorfolk_mf_p
BBC Radio Northampton http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrnthhnts_mf_p
BBC Radio Nottingham http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrnotts_mf_p
BBC Radio Oxford http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lroxford_mf_p
BBC Radio Sheffield http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrsheff_mf_p
BBC Radio Shropshire http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrshrops_mf_p
BBC Radio Solent http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrsolent_mf_p
BBC Somerset http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrsomer_mf_p
BBC Radio Stoke http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrsomer_mf_p
BBC Radio Suffolk http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrsuffolk_mf_p
BBC Surrey http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrsurrey_mf_p
BBC Sussex http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrsussex_mf_p
BBC Tees http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrtees_mf_p
BBC Three Counties Radio http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lr3cr_mf_p
BBC Wiltshire http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrwilts_mf_p
BBC WM 95.6 http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lrwm_mf_p
BBC Radio York http://bbcmedia.ic.llnwd.net/stream/bbcmedia_lryork_mf_p