Skip to content

Instantly share code, notes, and snippets.

@nodebugle
Forked from stengland/bbcradio.sh
Last active February 23, 2021 14:03
Show Gist options
  • Select an option

  • Save nodebugle/0e5e3754f4e8dbf608e72431b9c34484 to your computer and use it in GitHub Desktop.

Select an option

Save nodebugle/0e5e3754f4e8dbf608e72431b9c34484 to your computer and use it in GitHub Desktop.

Revisions

  1. nodebugle revised this gist Feb 23, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion bbcradio.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/bin/bash
    play() {
    playlist="http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_$1.m3u8"
    playlist="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_$1_mf_p"
    echo $playlist
    if mpc
    then
  2. nodebugle revised this gist Aug 16, 2019. 1 changed file with 6 additions and 4 deletions.
    10 changes: 6 additions & 4 deletions bbcradio.sh
    Original file line number Diff line number Diff line change
    @@ -1,22 +1,24 @@
    #!/bin/bash
    play() {
    playlist="http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/nonuk/low/ak/bbc_$1.m3u8"
    playlist="http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_$1.m3u8"
    echo $playlist
    if mpc
    then
    echo "Using mpc"
    mpc add $playlist
    mpc play
    else
    mplayer $playlist
    echo "Using mplayer"
    mplayer -msglevel all=0 $playlist
    fi
    }
    if [ -z "$1" ]; then
    echo "Select a station:"
    select s in radio_one radio_two radio_three radio_fourfm radio_five_live 6music
    select s in radio_one radio_two radio_three radio_fourfm radio_four_extra radio_five_live radio_five_live_sports_extra 6music
    do
    play ${s##* }
    break
    done
    else
    play $1
    fi
    fi
  3. nodebugle revised this gist Aug 1, 2016. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions bbcradio.sh
    Original file line number Diff line number Diff line change
    @@ -19,5 +19,4 @@ if [ -z "$1" ]; then
    done
    else
    play $1
    fi
    # GistID: 4052479
    fi
  4. nodebugle revised this gist Aug 1, 2016. 1 changed file with 2 additions and 6 deletions.
    8 changes: 2 additions & 6 deletions bbcradio.sh
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,6 @@
    #!/bin/bash
    play() {
    if [[ $1 == radio3 ]]; then
    playlist="http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls"
    else
    playlist="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_$1_mf_p"
    fi
    playlist="http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/nonuk/low/ak/bbc_$1.m3u8"
    echo $playlist
    if mpc
    then
    @@ -16,7 +12,7 @@ play() {
    }
    if [ -z "$1" ]; then
    echo "Select a station:"
    select s in radio1 radio3 radio3 radio4fm radio5live 6music
    select s in radio_one radio_two radio_three radio_fourfm radio_five_live 6music
    do
    play ${s##* }
    break
  5. @stengland stengland revised this gist Mar 19, 2015. 1 changed file with 7 additions and 3 deletions.
    10 changes: 7 additions & 3 deletions bbcradio.sh
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,22 @@
    #!/bin/bash
    play() {
    playlist="http://www.bbc.co.uk/radio/listen/live/r"$1"_aaclca.pls"
    if [[ $1 == radio3 ]]; then
    playlist="http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls"
    else
    playlist="http://bbcmedia.ic.llnwd.net/stream/bbcmedia_$1_mf_p"
    fi
    echo $playlist
    if mpc
    then
    mpc add $playlist
    mpc play
    else
    mplayer -cache 5120 -cache-min 1 -playlist $playlist
    mplayer $playlist
    fi
    }
    if [ -z "$1" ]; then
    echo "Select a station:"
    select s in 1 2 3 4 "5 Live 5l" 6 1x 4x "5 Live sports extra 5lsp" "Asian Network an"
    select s in radio1 radio3 radio3 radio4fm radio5live 6music
    do
    play ${s##* }
    break
  6. @stengland stengland revised this gist Jan 17, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion bbcradio.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,10 @@
    #!/bin/bash
    play() {
    playlist="http://www.bbc.co.uk/radio/listen/live/r"$1"_aaclca.pls"
    echo $playlist
    if mpc
    then
    curl -s $playlist | grep File1 | sed 's/File1=\(.*\)/\1/' | xargs mpc add
    mpc add $playlist
    mpc play
    else
    mplayer -cache 5120 -cache-min 1 -playlist $playlist
  7. @stengland stengland revised this gist Jun 25, 2013. 1 changed file with 8 additions and 3 deletions.
    11 changes: 8 additions & 3 deletions bbcradio.sh
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,13 @@
    #!/bin/bash
    play() {
    playlist="http://www.bbc.co.uk/radio/listen/live/r"$1"_aaclca.pls"
    # mplayer -cache 5120 -cache-min 1 -playlist $playlist
    curl -s $playlist | grep File1 | sed 's/File1=\(.*\)/\1/' | xargs mpc add
    mpc play
    if mpc
    then
    curl -s $playlist | grep File1 | sed 's/File1=\(.*\)/\1/' | xargs mpc add
    mpc play
    else
    mplayer -cache 5120 -cache-min 1 -playlist $playlist
    fi
    }
    if [ -z "$1" ]; then
    echo "Select a station:"
    @@ -15,3 +19,4 @@ if [ -z "$1" ]; then
    else
    play $1
    fi
    # GistID: 4052479
  8. Steve England revised this gist Jun 20, 2013. 1 changed file with 5 additions and 2 deletions.
    7 changes: 5 additions & 2 deletions bbcradio.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,9 @@
    #!/bin/bash
    play() {
    mplayer -playlist "http://www.bbc.co.uk/radio/listen/live/r"$1"_aaclca.pls"
    playlist="http://www.bbc.co.uk/radio/listen/live/r"$1"_aaclca.pls"
    # mplayer -cache 5120 -cache-min 1 -playlist $playlist
    curl -s $playlist | grep File1 | sed 's/File1=\(.*\)/\1/' | xargs mpc add
    mpc play
    }
    if [ -z "$1" ]; then
    echo "Select a station:"
    @@ -11,4 +14,4 @@ if [ -z "$1" ]; then
    done
    else
    play $1
    fi
    fi
  9. Steve England revised this gist Jan 14, 2013. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions bbcradio.sh
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    #!/bin/bash
    play() {
    mplayer -playlist "http://www.bbc.co.uk/radio/listen/live/r"${1##* }"_aaclca.pls"
    mplayer -playlist "http://www.bbc.co.uk/radio/listen/live/r"$1"_aaclca.pls"
    }
    if [ -z "$1" ]; then
    echo "Select a station:"
    select s in 1 2 3 4 "5 Live 5l" 6 1x 4x "5 Live sports extra 5lsp" "Asian Network an"
    do
    play $s
    play ${s##* }
    break
    done
    else
  10. Steve England revised this gist Jan 14, 2013. 1 changed file with 13 additions and 7 deletions.
    20 changes: 13 additions & 7 deletions bbcradio.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,14 @@
    #!/bin/bash

    echo "Select a station:"
    select s in 1 1x 2 3 4 4x "5 Live 5l" "5 Live sports extra 5lsp" 6 "Asian Network an"
    do
    mplayer -playlist "http://www.bbc.co.uk/radio/listen/live/r"${s##* }"_aaclca.pls"
    break
    done
    play() {
    mplayer -playlist "http://www.bbc.co.uk/radio/listen/live/r"${1##* }"_aaclca.pls"
    }
    if [ -z "$1" ]; then
    echo "Select a station:"
    select s in 1 2 3 4 "5 Live 5l" 6 1x 4x "5 Live sports extra 5lsp" "Asian Network an"
    do
    play $s
    break
    done
    else
    play $1
    fi
  11. Steve England renamed this gist Nov 10, 2012. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  12. Steve England created this gist Nov 10, 2012.
    8 changes: 8 additions & 0 deletions bbcradio
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #!/bin/bash

    echo "Select a station:"
    select s in 1 1x 2 3 4 4x "5 Live 5l" "5 Live sports extra 5lsp" 6 "Asian Network an"
    do
    mplayer -playlist "http://www.bbc.co.uk/radio/listen/live/r"${s##* }"_aaclca.pls"
    break
    done