How to download BBC iPlayer programmes

I’ve found the BBC iPlayer client very frustrating to use. Even though the client is cross-platform thanks to Adobe Air – it’s slow and sometimes doesn’t allow you to download a programme when you should be able to.

Also, it doesn’t work properly on 64-bit platforms such as Ubuntu (which is what I use), so the process becomes even more difficult.

So, after getting quite fed up with iPlayer still not quite delivering – I had a scoot around the internet and found a very useful program which will download those videos very nicely.

get_iplayer boasts that it can download BBC TV, radio and ITV onto your computer. Not only this, but it can also be scheduled to download your favourite programmes just like a PVR. So it’s like Sky+ or TiVo, but better. But bear in mind the disclaimer:

Of course, to respect the content providers’ wishes and fair-use legislation, you should keep the recorded content for no longer than 30 days (in the UK), not attempt to obtain it from outside of the UK and not redistribute it. get_iplayer is not intended for use in making illegal copies of copyrighted content. Please respect the rights of the content owners when recording. get_iplayer will attempt to remove its recorded content which is more than 30 days old.

Getting Started
First thing’s first, we need to install it. I’ll assume that you’re using Ubuntu Linux for this, but you can install this on Linux, Mac or Windows.

First of all, download the get_iplayer package from the download page. You’ll also need the flvstreamer package to download the high quality videos.

Once downloaded and installed, you’ll be all set to start downloading. The first thing to do is get an up to date list of programmes. Running

<code>get_iplayer</code>

On its own will refresh the BBC feed and list all the programmes curently available. There may be a lot so you might want to search by the title of the programme:

<code>get_iplayer "Top Gear"</code>

will list all of the BBC iPlayer programmes matching the phrase “Top Gear”

Now you decide that you want to download all of the “Top Gear” series, you can download them with:

<code>get_iplayer "Top Gear" --get</code>

This will download all the available episodes of Top Gear as a .mov file. Using additional parameters, you can also download in various formats such as HD .mp4 files.

Alternatively, if you’ve got the link to a program and you want to download it without any fuss – then you just need the URL or the ID of the programme to download it instantly:

<code>get_iplayer --get --pid http://www.bbc.co.uk/iplayer/episode/b007vl20/Will_Smith_Presents_The_Tao_of_Bergerac_Episode_3/</code>

This will download the radio show The Tao of Bergerac onto  your computer without the need for searching for the programme through the get_iplayer command line tools.

There is loads more you can do, such as using get_iplayer as a PVR. The documentation covers the different commands well, and is definitely worth having a squint through. Just remember to watch how much you’re downloading if you have capped bandwidth from you internet provider.

If you feel like something a bit more graphical, the is also a get_iplayer PVR Manager available to try.

Happy downloading!

SCP and filename spaces

An issue that pops up for me occasionally is that scp doesn’t much like copying filenames that contain spaces. When you use the scp command, even in quotes – the result is that scp treats each space as a separate file.

Thankfully, there is a way to easily fix this. You need to enclose the filename in two sets of quotes. I’m guessing that one is for scp itself, and the other is for the target machine to resolve:

<code>scp user@remote-pc:"'/home/user/my long filename'" ./</code>

Notice that the path is wrapped in single quotes, and then the single quotes wrapped in double quotes. This seems to resolve the issue nicely, and still works with directories as well.

Reset your MediaWiki Sysop Password

When you’re stuck without sysop access to MediaWiki because you cannot remember the sysop details then there’s a handy maintenance script that’s available (if you’ve used the package manager) to reset the sysop username and password.

On Ubuntu server you can run the following command:

php /usr/share/mediawiki/maintenance/changePassword.php --user=sysop --password=password

The script will immediately reset your sysop username and password with what you have entered above.

Now you can log in without any problems!

CodeIgniter’s Form Helper doesn’t respect POST arrays

I’ve been working on my first ‘proper’ CodeIgniter project this week. It’s been quite gruelling, as there are some moments where I have definitely sped up my production. But it’s constantly getting hampered by the learning curve. It may be slight, but is frustrating when I hit a wall.

One issue that just cam up is that I want to send multi-dimensional post data to the set_value function in the Form Helper. As you’re passing a string, the array is completely disregarded, and you’re left with nothing.

I’ve created an extension to the helper to temporarily get around the problem until I can look at it and fix it properly:

MY_form_helper.php

<code>

<?php
if ( ! function_exists('set_value_arr'))
{
	function set_value_arr($field = '', $id = '0', $default = '')
	{
		if (FALSE === ($OBJ =& _get_validation_object()))
		{
			if ( ! isset($_POST[$field][$id]))
			{
				return $default;
			}

			return form_prep($_POST[$field][$id]);
		}

		return form_prep($OBJ->set_value($field, $default));
	}
}

?></code>

This sets a second parameter as the array index. This way, you should be able to access form elements sent into the POST array as arrays themselves.