Running your own radio station recorder

Discussion in 'Tutorials and Guides' started by wlanboy, Nov 14, 2013.

  1. wlanboy

    wlanboy Content Contributer

    2,126
    1,169
    May 16, 2013
    I like to listen to some radio stations but there are some shows that have bad airtimes.

    So my Raspberry Pi (with an attached 500GB usb drive) is my personal radio recorder.

    1. How do you get the stream urls of your favorit radio station?

    Visit listenlive.eu to get a quite complete list of all radio stations per country.

    This site is providing all links for the different bitrates too.

    2. Install streamripper


    sudo apt-get install streamripper

    3. Run streamripper


    streamripper http://lyd.nrk.no/nrk_radio_p1_finnmark_aac_h.m3u -d /home/wlanboy/radio/ -l 7200

    The pattern is:


    streamripper [url of stream] -d [folder to save musik files] -l [time in seconds to record music]

    Last optional step is to setup a cronjob to call streamripper.

    Each radio station will get a own sub folder.
     
    Last edited by a moderator: Nov 17, 2013
    peterw and drmike like this.
  2. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,717
    May 13, 2013
    I've been using streamripper for a long time now.

    Only problem I have with it is with network hiccups.  When that happens, the recording splits into another file.  So a single recording might end up with 2-4 different files.

    Any idea of how to prevent that and have it run a continuous single file in these instances? 
     
  3. wlanboy

    wlanboy Content Contributer

    2,126
    1,169
    May 16, 2013
    There are two options:

    1. -A

      -A - Don't write individual tracks
      -m timeout     - Number of seconds before force-closing stalled conn

    2. -p
      Code:
      -p url         - Use HTTP proxy server at <url>
      

    I use 1) to ensure that one show is stored in one file and that small timeouts are ignored.

    Option 2) might be an option if you rely on a proxy which does support caching/buffering.
     
  4. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,717
    May 13, 2013
    @wlanboy,   I saw those options.   Will tinker with my script / wrapper for streamripper to see if any of these correct the misbehaving. 

    Off to edit :)
     
  5. drmike

    drmike 100% Tier-1 Gogent

    8,573
    2,717
    May 13, 2013
    Well, I already  -m  timeout in my wrapper script.  Bounced the time limit up to 60 seconds.  Ideally that helps.

    I had -a in options, but not -A which does entirely different thing.   Someone wasn't thinking with same letter option there...

    Throwing this in the script too:

    --xs-none

    --xs-none   (Don't search for silence)   

    Silence is unimportant since I am not using Streamripper to rip individual tracks down to different files but instead ripping entire shows (i.e. one hour or multi hour production inclusive of commercials).
     
    peterw likes this.
  6. peterw

    peterw New Member

    800
    189
    Jun 14, 2013
    I do have the same problem that streamripper sometimes starts stuttering. I will try your parameters.