Introduction
Get_iplayer is a Perl script for downloading content from BBC iPlayer website. It originally written by Phil Lewis, it is currently maintained by at infradead.org. The content downloaded by get_iplayer does not have DRM restriction. This means that you can use any media player to play them, and there is no time restriction on how long you can keep the file. However it should be noted that it is against the UK copyright law to keep those files for longer than 7 days. I always delete mine after 7 days.
Get_iplayer by default can only download iPhone quality content. If you want to download content with higher quality, you need to install additional software.
Rtmpdump is required to downloading video with “flashhigh” and “flashvhigh” quality, as well as radio programmes. Rtmpdump stores files in the format of flv. If you have ffmpeg installed, the script will automatically convert video flv files into mp4 format, and radio flv files to aac format. If your ffmpeg was compiled with “–enable-libmp3lame” option, you can set get_iplayer to convert radio flv files to mp3 format automatically.
If you have atomicparsley installed, the mp4 files will be tagged automatically with descriptions of the TV programmes. If you have id3v2 installed, mp3 files will be tagged automatically.
Installation
I have machines running Debian and Ubuntu. I also have a Windows machine with Cygwin on it. So I will briefly cover how to set get_iplayer up in these environments.
Debian
You need for first add Debian Multimedia Repository into your APT source list. Then you need to install the signing key for the packages in this repository. You can do so by typing in:
apt-get install deb-multimedia-keyring
You will get some warning, please ignore the warning and carry on. Now install the required packages:
apt-get install ffmpeg atomicparsley id3v2 rtmpdump get-iplayer
Ubuntu
You need to type in these:
apt-get install atomicparsley id3v2 rtmpdump get-iplayer
You then need to compile ffmpeg, as Debian is moving from ffmpeg to libav, and there does not seem to be a repository with ffmpeg.
Cygwin
It is considerably harder to get get_iplayer working in Cygwin. You can use the package from Cygwin Ports. However the packages from Cygwin Ports seem to be less stable than the ones in the official Cygwin Repository.
Alternatively you can compile everything from source. It is totally doable. If you want your radio programmes in mp3 format, you need to add the “–enable-libmp3lame” option when you are compiling ffmpeg.
You also need some extra Perl modules, which you can install from CPAN shell. In order to get CPAN to automatically install all dependencies, you can use the following command.
PERL_MM_USE_DEFAULT=1 perl -MCPAN -e ‘shell’
Using get_iplayer
The documentation for get_iplayer can be found here. You can also get help by using the “–help” option or the “–help-long” option
By default get_iplayer downloads content iPhone quality. You can add user options to get_iplayer, so it always downloads higher quality content. This can be done by using the “–add-prefs” option. You can also manually edit ${HOME}/.get_iplayer/options in order to change settings.
If you use Cygwin, and you manually compiled some packages required by get_iplayer, you need to either put the binaries are in the path, or specify them in get_iplayer’s user options.
The content for my ${HOME}/.get_iplayer/options is:
tvmode flashvhigh
aactomp3 1
mp3vbr 0
subtitles 1
So on my setup, get_iplayer downloads very high quality video, and radio programmes are saved as high quality mp3 files.
Downloading iPlayer video outside the United Kingdom
It is possible to download iPlayer video from location outside the United Kingdom. You simply need to install Tor, and restrict its exit node to UK only. This can be done by modifying the torrc file. In Debian, it is located in /etc/tor/torrc. You need to insert the following two lines in the file:
ExitNodes {gb}
StrictNodes 1
Then you need some kind of software which converts Tor’s SOCKS proxy to a HTTP proxy. I personally use Privoxy. Some people prefer Polipo. My problem with Polipo is that it randomly crashes. Privoxy is available in both Debian and Ubuntu’s repository. It is also available on Windows natively. Add the following option to your Privoxy:
forward-socks5 / localhost:9050.
This forwards all the request to Privoxy to the SOCKS proxy you have just created. Now, you probably want to add the proxy option permanently into your get_iplayer setting file. You can do this by the following:
get_iplayer –add-prefs –proxy http://127.0.0.1:8118
Now you can use get_iplayer to download video as usual. Tor is only used to get the feed files. BBC restricts these feed files to UK IP addresses. BBC’s RTMP server does not restrict the IP address. RTMP connection is not tunnelled over HTTP proxy.
I do max out my bandwidth when I download iPlayer videos in China, so it is all good.