Hacking BBC iPlayer; How the BBC secretly went DRM-free and I saw the Emperor's New Clothes
Last Friday, the BBC quietly rolled out a version of their much-criticised (and rightly too!) iPlayer to support Apple's iPhone and iPod Touch. What they didn't want people to know is that, because the Apple devices brilliantly lack Adobe Flash support, their hand was forced into delivering an MPEG4 stream. More than that, because they haven't licensed Apple's DRM (after all, they've spent a fortune on that Microsoft tat), they're delivering streams to small Apple devices with no DRM restrictions.
As soon as I heard about the iPhone support, I knew it had to be handled in a manner different to the streaming Flash. The Flash streams are handled by a proprietary Adobe protocol called RTMP (Real-Time Messaging Protocol, although I like the idea of it being Read The Motherflippin' Pamphlet) which is a headache to try and get data from in anything other than Flash. It's possible, as Pip found out, but not with free software (at least as far as our experiments concluded). So other means were being used. I set Firefox up to pretend to be an iPhone and headed to the BBC iPlayer site.
After wading through various scripts, I discovered something quite splendid - MPEG4 files were being distributed over HTTP, and after snagging one, it was truly DRM free. I did what anybody in my position would do - I put a screenshot up on Flickr, and showed Pip my handiwork.
Then the news spread and the traffic started, helped mostly by legendary copyfighter Cory Doctorow making a big deal about it over at BoingBoing. My investigative ham-fisted hackings inspired a bunch of other people to write scripts to pull the MPEG4 files from the servers, whilst other people found the same thing at roughly the same time and started making the most of it.
All in all, 7th March 2008 should be remembered as the day the BBC accidentally opened the flood gates and gave the world DRM-free downloads. If only it were down to something other than poor-design, decisions and ineptitude by the department running the project - the department that pissed millions up the wall and spent many months making a dire Windows-only DRMed offering that has been largely ignored since the leaner streaming Flash afterthought was added to attempt to appease the techie populous.
Anyway, a quick review of the MPEG4 files - they're pretty good. Not high def by any stretch of the imagination, but then the target platform is a handheld device. I've found the picture quality to be a bit better than the Flash stream (but with the advantage of being able to save them without black arts being involved), and better than some of the Windows downloads I saw when iPlayer was launched. Perfectly watchable, and brilliantly watchable on anything that can handle MPEG4 - so all the platforms that the BBC had been ignoring, hoping the grumbling would go away. I recoded Ashes to Ashes to fit my iPod because, being DRM-free and based on a published standard, it's possible to do this...
What will the BBC do next? Who can say. They have a few options, though. They could discontinue support for the iPhone and have expensive egg on their face. They could license FairPlay from Apple, giving the streams DRM, and face questions from the board of governors and the government about why they're wasting licence-fee money on two different forms of DRM. They could carry on as it is, and hope that a tiny minority of people use it, or they can embrace the future and offer it up to all. I imagine the third option will be what they choose, but we can hope for the fourth.
Anyway, my favourite implementation of laying hands on MPEG4 files come courtesy of Matthew Somerville. It's awesome goodness. So awesome that I hacked together this Bookmarklet! Drag the following link up to your bookmarks, and then click it whenever you're on an iPlayer page and you'll be whisked off to Matthew's site where you can see what you can actually get hold of.
And that, my friends, is what I did with my weekend.








now the BBC seem to have
now the BBC seem to have blocked this work around, do y ou have any tips?!
Cracking the 'block'
Their new "security" system is based on a weakness in the implementation of Math.random on the iPhone. Put simply, Math.random isn't random, it follows a sequence. Once I've got that discovered (by getting my iPhone-owning colleague to visit a web page I've crafted to output the sequence) I'll be through that. If there's any more than that I'll get him connected through a proxy and look at the transfers to see what's going on.