The BBC and Open Formats


It seems as though the BBC has decided to remove the links to the .ram files from their listen again service. I noticed that only some of the programmes had this link a while ago and now they all seem to have gone. I presume this is to make it harder to copy the stream to a mp3 or ogg file.

Obtaining the ram file is still pretty easy, in fact using the command line to get it is easier than copying the previous link. So on a Linux command prompt enter:

curl http://www.bbc.co.uk/radio/aod/genres/comedy/aod.shtml?radio4/nowshow | grep [.]ram

Where the link is a copy of the link to start playing the file. This should give one line on the console starting something like:

<a href="/radio/aod/shows/rpms/radio4/nowshow.ram"><img src="/radio/aod/images/ico_realplayer.gif" width="16" height="12" alt="" border="0" align="left" vspace="1" />Listen using stand-alone Real Player</a><br clear="left" />

Put this link to the .ram file into my script, add the http://www.bbc.co.uk on the front, and this will create an mp3 or ogg file of the show.

#! /bin/bash

# A script to record BBC Listen Again programs.
# Orignal by Seb James 2007
# Extended by Stuart Ward 2007
# Released under the terms of the GNU GPL.
#
# Usage example:
# convert_real http://www.bbc.co.uk/radio/aod/shows/rpms/radio4/six_pm_news.ram
# Where the argument is the content of the link on the bbc site
# called "Listen using stand-alone Real Player"
#
# This program will take as almost as long as it takes to listen to the
# program, plus as long as it takes to convert the realaudio file to a wav
# file, and then to encode it as an mp3 or ogg-vorbis file.
#
# mplayer with realaudio support via proprietary codecs must be installed.
# oggenc or lame is required. Default is mp3 format

ENCODE="mp3"
QUIET=
STREAM=
SUFFIX=
PROGRAM=$0
BITRATE="-b 128"

while [ $# -gt 0 ]
 do
 case $1 in
 --mp3 | -m)
 ENCODE="mp3"
 ;;
 --ogg | -o)
 ENCODE="ogg"
 ;;
 --quiet | -q)
 QUIET="-quiet"
 ;;
 --date | -d)
 SUFFIX=$(date +%Y%m%d)
 ;;
 --bitrate | -b)
 BITRATE="-b " $1
 ;;
 -*)
 echo "Unrecognised option: $1"
 ;;
 *)
 STREAM=$1
 ;;
 esac
 shift
done

if [ -z $STREAM ]; then
 echo "Usage:"
 echo "$PROGRAM [--mp3 | --ogg] [--quiet] http://www.bbc.co.uk/.../six_pm_news.ram"
 echo "Where the argument is the content of the link on the BBC's web radio player "
 echo "called \"Listen using stand-alone Real Player\""
 exit
fi

# Create a folder in which to work.
mkdir -p $HOME/radio

# And make that the working directory.
cd $HOME/radio

ramfile=${STREAM##*/}
outfile=${ramfile%.*}$SUFFIX
if [ -z $QUIET ]; then
 echo "Filename: $outfile.$ENCODE"
 echo "Stream: $STREAM"
fi

# This will get the stream idenity parameters

mplayer -vo null -ao null -frames 0 -nocache -identify -playlist $STREAM \
 2>/dev/null | grep "^ID" | \
 sed 's/=/=\"/ ; s/$/\"/' >$HOME/radio/$outfile.id

. $HOME/radio/$outfile.id
if [ -z $QUIET ]; then
 echo "Title :" $ID_CLIP_INFO_VALUE0
 echo "Artist :" $ID_CLIP_INFO_VALUE1
 echo "Copyright :" $ID_CLIP_INFO_VALUE2
fi

if [ ! -p $HOME/radio/$outfile.pipe ]; then
 mkfifo $HOME/radio/$outfile.pipe
fi

started=$(date)
# Thanks to Mike McKay (http://www.vdomck.org/) for the named pipe method here:

if [ $ENCODE = "ogg" ]; then
 oggenc --quiet -q 1 $BITRATE -t "$ID_CLIP_INFO_VALUE0" \
 -a "$ID_CLIP_INFO_VALUE1" -o $outfile.ogg \
 $HOME/radio/$outfile.pipe & \
 mplayer -vc null -vo null $QUIET \
 -ao pcm:fast:file=$HOME/radio/$outfile.pipe \
 -playlist $STREAM

# for mp3 files, use lame to encode

elif [ $ENCODE = "mp3" ]; then
 lame --quiet --tt "$ID_CLIP_INFO_VALUE0" --ta "$ID_CLIP_INFO_VALUE1" \
 -h -v $BITRATE $HOME/radio/$outfile.pipe $outfile.mp3 & \
 mplayer -vc null -vo null $QUIET \
 -ao pcm:fast:file=$HOME/radio/$outfile.pipe \
 -playlist $STREAM
fi

# remove the named pipe
rm -f $HOME/radio/$outfile.pipe
if [ -z $QUIET ]; then
 echo "Started: $started Finished: $(date)"
 echo "Title :" $ID_CLIP_INFO_VALUE0
 echo "Artist :" $ID_CLIP_INFO_VALUE1
 echo "Copyright :" $ID_CLIP_INFO_VALUE2
 echo "Successfully created the program. $outfile.$ENCODE"
fi

This also raises the issue in my mind if this is legal, and from my reading of the BBC terms and conditions it would be, then why is the BBC trying to make it difficult to do. Are we not creating a divided society where the computer literate have better access to information because they can get around silly roadblocks.

Some of the BBC shows are available as podcasts, though this is very limited in the scope compared with the total radio output of the BBC.

Because I can transfer TV shows to my laptop from my mythtv system and play them on the train, without breaking any DRM or having any arbitrary time limits but the general public have to use the likes of iPlayer, or 4OD that have all of these restrictions in place, I have better access to information. Is this right.

I can here the counter arguments that releasing this onto the Internet in these formats would encourage rampant copyright infringement. I believe that the fundamental point here is that the law works in a retrospective manner. You are punished for the deeds you have committed, there should not be limitations on information that disenfranchise the majority of the law abiding public because of a few who would abuse that access and break the law.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: