Latest iPlayer changes revisited

I updated my downloader the other day to keep up with the latest round of changes to the iPlayer service. However, I missed some complications regarding age-restricted programmes, and it wasn’t possible to download those at all.

I’ve fixed the problem, so go and update if you haven’t already.

Here’s how downloading currently works:

  • GET the iPhone programme page (http://www.bbc.co.uk/mobile/iplayer/episode/PID) using the iPhone user agent.
  • If there’s an age restriction form, make a POST to the same address, sending the form parameters (e.g. form=guidanceprompt&isOver16=1)
  • Extract the streaming URL from the embed element.
  • GET the stream using the CoreMedia user agent and an appropriate Range header.

Cookies need to be captured and sent throughout the process, including in the final download step.

Jubilee Line Fail

If, like me, you live on the Jubilee Line, you’ll be familiar with the ongoing incompetence of the upgrade currently being carried out. This upgrade was due to finish in March 2009. It’s still going on, with line closures scheduled for almost every weekend through to April 2010.

In order to keep track of the weekends when I won’t be able to use the line, I’ve made a public calendar. You can import this into your own calendar using this link (you probably need to copy and paste the URL itself):

I’ve based it on TfL’s press release. Let me know of any errors or omissions.

A cessation of hostilities?

The iPlayer changed again today, which broke my downloader. It was a surprise to me: I had thought that the cat and mouse game of countermeasure and counter-countermeasure was over. Had the BBC regrouped for another round?

Well, no. It didn’t take me long to understand the changes. In fact, the latest iteration of the iPlayer-for-iPhone is significantly simpler than the last. It’s just a page with an embedded movie. There are no fiddly web bugs to authorise the client, and there’s no need to resolve the programme ID to a version ID first.

I don’t know the reasons behind it, but I’d like to imagine that someone in charge has recognised the quixotic nature of all attempts to thwart downloads. After all, people have now been downloading iPlayer programmes for a couple of years. The sky hasn’t fallen. Why waste time complicating and obfuscating when you could be making it simpler and better?

Have sensible technical decisions prevailed over futile political ones? I can only hope so.

Latest iPlayer changes

The BBC have tweaked the iPlayer again, and I’ve used my lunch break to update my downloader to keep up. If you’re using the command-line version via Ruby Gems, you can update to version 0.1.17 right now by typing

sudo gem update iplayer-dl

Other options are on the project page. I’ll build the Windows GUI later tonight.

I don’t believe in anthropogenic global warming

I don’t believe in anthropogenic global warming, because there’s no way that six billion people burning millions of years of sequestered carbon could possibly affect the atmosphere of the planet in any measurable way.

I don’t believe in anthropogenic global warming because I don’t like the arrogant certainty of these scientists with their facts and analyses. The world is more complicated than facts. And anyway, you know who else liked science? Hitler! And Stalin!

I don’t believe in anthropogenic global warming because, anyway, I read this article by this one guy who didn’t believe in it. And he was a scientist! So, you see, there’s no consensus: the jury’s still out.

I don’t believe in anthropogenic global warming because that hockey stick graph was fiddled. And if that graph was wrong, it logically follows that everything else connected with climate change is wrong.

I don’t believe in anthropogenic global warming because in the 1970s everyone was worried about a new ice age. These scientists can’t even make their minds up!

I don’t believe in anthropogenic global warming because it’s actually colder this winter than last winter. Some global warming that is!

I don’t believe in anthropogenic global warming because Jeremy Clarkson said it’s rubbish. Sure, on the one hand you’ve got an overwhelming majority of climatologists saying that it’s real, but, on the other hand, he’s a celebrity. That’s got to count for a lot, right? Plus, he’s telling me exactly what I want to hear.

I don’t believe in anthropogenic global warming because I read some leaked emails in which climate scientists were rude about people who don’t believe their findings. Therefore, everything they conclude is suspect.

I don’t believe in anthropogenic global warming because it’s obviously some secret deal by the global élite to give them an excuse to kill millions of people. What do you mean, why would they want to do that? I’m not the one with the crazy ideas!

I don’t believe in anthropogenic global warming because I like driving my car between my suburban home and the out-of-town supermarket. It reinforces my sense of manly purpose. I also enjoy taking cheap flights to southern Europe on holiday. I can’t believe in any future in which these things aren’t God-given rights.

I don’t believe in anthropogenic global warming because fuck you, I’ll be dead by the time Bangladesh is under water, and I won’t have to live in the desertified planet my selfish and blinkered choices leave behind.

A proposal for idiot-proofing bank account details

Take a valid credit card number, such as 4111-1111-1111-1111, change it slightly, to 4111-2111-1111-1111, and it ceases to be valid. This is because the last digit of the number is a checksum calculated from the preceding digits via the Luhn algorithm. It’s not particularly clever; it’s not cryptographically secure. It’s not meant to be. What it’s intended to do is to protect against accidental data entry errors, and it does that very well.

Now, compare the system for bank transfers in the UK. You enter a six-digit sort code (usually given as three pairs, e.g. 11-22-33). This corresponds to the branch. To this you add an eight-digit account number.

If you get one of the digits wrong, one of two things happens. If you’re lucky, the transfer is rejected and the sum is returned to the originating account.

If you’re unlucky, the sum disappears into BACS and you have to fill in forms and wait six weeks to try to get it back.

There may even be a third case, in which a typo generates an alternative valid bank account, making it even harder to reclaim the lost funds. I don’t know how likely this is, as I don’t know how banks distribute account numbers.

Having been a victim of the second case (due to an estate agent sending me the bank details that were off by one digit), I feel like simple transcription errors could and should be prevented, and I think we could do it pretty easily.

Here’s my proposal: create a transfer format for bank account details that includes a checksum, allowing the detection of errors before monetary loss ensues.

In fact, we don’t need to. It already exists! The IBAN, or International Bank Account Number, specifies a format that does exactly this.

Instead of:

12-34-56 98765432

You use something like:

GB82 WEST 1234 5698 7654 32

It’s not too much longer, and you can be reasonably confident that no one’s made a typo somewhere.

Although intended for cross-border transactions, there’s no reason why we shouldn’t use IBANs for domestic payments. The functionality could be added to online banking systems fairly trivially (I’d optimistically quote half a day’s work) without needing any change to the back-end systems.

We can’t stop estate agents screwing up, but this might be the next best thing.

Why do we want newspapers to survive, again?

When I saw this Daily Express front page online, I thought it must be a parody. It wasn’t until I saw a physical copy of the paper the next day that I really believed that they had actually printed something so inflammatory and xenophobic:

Daily Express front page: Keep Out, Britain is Full Up

The current outrage over the BNP, who won a couple of European Parliament seats earlier this year, and whose Führer Nick Griffin was invited on a specially-convened inquisitorial edition of BBC Question Time this week, is more than a little disingenuous.

The demagogic press has been creating and provoking anxieties over immigration and imagined Muslim fifth columnists for quite some time. The Labour government has responded, not by correcting the lies and misperceptions (such as immigrants jumping the housing queue) but by loudly introducing crowd-pleasing immigration controls (like the risible UK Citizenship pub trivia quiz) in some bizarre attempt to outflank the overtly racist BNP.

But the truth appears to be that racism and xenophobia win votes. They also sell papers. Anton Vowl has performed a valuable public service by looking back over recent front pages and stories from the newspapers that are currently excoriating Griffin for the same views, and the BBC for allowing him to present them.

Here’s an example from the Daily Star of a particularly toxic headline:

BBC PUT MUSLIMS BEFORE YOU

The old canard of special treatment for the other is there, but there’s a more insidiously hateful message behind it: Muslims are not ‘us’. We’ve heard that message before.

There’s been a lot of hand-wringing of late about the demise of print newspapers. Personally, I’d be happy for all newspapers to go out of business if it meant the death of spiteful organs like the Star, Express, and Mail. Sure, they’d be replaced by hateful online publications, but, without such an oligopoly on information, the Two Minute Hate against Muslims and foreigners would be harder to co-ordinate.

In reality, though, I suspect that these newspapers will probably cling onto life the longest, using ever more outrageous front page headlines to draw in the crowds.

So, anyway, go and read Hmm … remember this?

Defying monoculture

It may surprise many people, but Microsoft is fairly irrelevant to my daily life. I don’t use Microsoft Windows. In fact, no one in my office uses Windows. I don’t use Microsoft Office. At work, I have a Mac; at home, I run Linux.

I don’t use Windows because, frankly, I think it’s a bit shit. It’s clunky and user-hostile. Even when they manage to disguise the mouldering tower of hacks and kludges behind a glossy skin, as in Windows 7 (I have tried the betas) the design decisions seem to be driven more by political and economic concerns than by technical ones. Windows is the Ryugyong Hotel of operating systems: poorly made, expensive, casting a huge shadow, and recently fitted with a new façade of shiny glass.

So today’s release of Windows 7, breathlessly echoed by journalistically subnormal organs like BBC News, is of about as much immediate relevance to me as Kim Jong Il’s entertainment schedule.

Occasionally, though, the Microsoft monoculture rears its ugly head in places where I can’t ignore it. Yesterday, I learned via the cloudsourced blog that some useful information was available free from the Office for National Statistics:

Boundaries for Output Areas (OAs), Lower Layer Super Output Areas (LSOAs), Middle Layer Super Output Areas (MSOAs) and Travel to Work Areas (TTWAs) are available free of charge to all users.

I’d like that. How do I obtain this information?

To obtain boundaries, please complete a boundary request form from the Downloads section and email it to ONS Geography.

What is the request form?

Boundary request form 1.21 Mb Word document

D’oh! ‘Microsoft Word Document’ is a proprietary format, while the ONS is a (non-ministerial) government body. It’s a .gov.uk site. I think it’s inappropriate for the state to provide data only in proprietary formats controlled by a third party. Computing should not require a payment to Microsoft, or any other company, and the state should not assist in reinforcing Microsoft’s monopoly.

Under normal circumstances, I’d install a piece of free software whose programmers have managed to reverse engineer the Word document format, and use that to decipher the file. OpenOffice.org, for example. That would have been easy, but it wouldn’t have been right. I felt that it was important in this case not to acquiesce. I emailed them:

However, my computer is unable to display proprietary Microsoft Word documents, and I am thus unable to fill in the ‘Boundary request form’. Please therefore let me know what additional information you require to fulfil this request.

They probably think I’m an ass. They would be right: I am an ass. But if no one made a fuss, how would they know that their assumption that everyone has Microsoft Office is erroneous?

The ONS replied to my request, asked for my address, and have already despatched the CDs with the data. So I get what I wanted, and I’ve made a point.

There is of course a time and a place for such bolshiness: I don’t expect anyone to start rejecting customer or client documents because they don’t like Microsoft formats. But next time a state body assumes that everyone is uses Microsoft Windows and Office, gently correct them. Maybe at some point they’ll realise.

And if you don’t know why all this matters, read the cautionary tale of South Korea and the SEED cipher:

This nation is also a unique monoculture where 99.9% of all the computer users are on Microsoft Windows. This nation is a place where Apple Macintosh users cannot bank online, make any purchases online, or interact with any of the nation’s e-government sites online.

It’s a hard assumption to undo.

iPlayer Downloader fixed again

I’m back from holiday, I’ve slept, and I’ve fixed the latest round of problems with the downloader.

Get your updates on the project page!

Ruby people who use the command line version might be pleased to know that it’s now available as a gem via the new Gemcutter service. If you’ve added Gemcutter as a source, just do (with sudo as required):

gem install iplayer-dl

Otherwise, you’ll need to specify the source:

gem install iplayer-dl --source http://gemcutter.org

Things to do with leaked postcode data

An interesting file turned up on Wikileaks yesterday:

UK government database of all 1,841,177 UK postcodes together with latitude and longitude, grid references, county, district, ward, NHS codes and regions, Ordnance Survey reference, and date of introduction. The database was last updated on July 8, 2009 and is over 100,000 pages in size.

Something that I thought might be interesting is to see how postcodes are distributed within an area. I took all the postcodes from my local area (SE16), put them in alphanumerical order (1AA, 1AB, ..., 1ZZ, 2AA, ... etc.) and used JavaScript and the canvas element supported by newer browsers to visualise them.

They’re plotted on a (colour-blindness-friendly) colour continuum from blue to yellow, with a short delay between each. This results in something like this:

SE16 postcodes visualised

It’s interesting to see that postcodes are allocated roughly in a clockwise spiral out from the centre. The reason why they are all in a slightly skewed grid is, I think, a result of the latitude/longitude being translated from OS grid references.

You can watch the animation here if your browser supports it. Safari, Firefox, Opera should be fine. Internet Explorer need not apply.