Downloading Programmes From 4od – Linux

There used to be an official application created by Channel 4 which allowed you to download from their on-demand service, 4od, but this has since been discontinued and is no longer available. This sucks if you don’t have a stable or quick internet connection, because it means that you have to put up with buffering and low quality streams available. It’s understandable as to why it’s no longer available; Channel 4 is not like the BBC which is uniquely funded by the TV license, but rather relies on advertising to generate revenue. Download programmes and watching them outside of the 4od framework obviously denies them this revenue source, so please consider this solution only if streaming shows from the 4od channel on YouTube or via the 4od website is unreasonable.

Rob Watkins has created a Ruby script which allows you to download 4od programmes from the website and play them back in a local media player. He has made it publicly available on GitHub with instructions on how to use it on OS X. Here’s how to get it running on Linux.

There are a few prerequisites that we must sort out before we can go ahead and run the script, but thankfully they’re pretty easy to get hold of. I’m writing this with Ubuntu 12.04 in mind, but it should be very similar regardless of which distribution you’re on. Just replace apt-get with whatever your distribution’s package manager is and hope that they’re available in the software repositories. RTMPDump needs to be at least version 2.4 for this to work.

Open a terminal and run the following command:

wget -P 4od-dl https://raw.github.com/robwatkins/4od-dl/master/4od-dl.rb

This will create a directory called 4od-dl and download the 4od-dl script to it.

Now that we have the script, we need to download the dependencies. There aren’t too many, and shouldn’t take more than a couple of minutes to get. Type the following into the terminal

sudo apt-get install ruby1.8 rubygems ffmpeg rtmpdump atomicparsley
sudo gem install logger hpricot crypt

Now we have everything we need to download our first programme. All 4od programmes are
identified by an ID which we can get from the URL of the programme on the 4od website. For example, the following Grand Designs episode has ID 3264880: http://www.channel4.com/programmes/grand-designs/4od#3264880. When you have the number, run the 4od-dl script, replacing 3264880 with whatever the ID of your programme is:

cd 4od-dl
ruby 4od-dl.rb -p 3264880

This will start the download and if all goes well, you should find a .mp4 file of the downloaded programme when it finishes. It is free from DRM so you can theoretically keep it indefinitely, but it’s generally considered acceptable to keep TV recordings for personal use for 30 days.