Archive for March, 2008

“One line” iPlayer download script

Friday, March 28th, 2008

Thought I’d see if I could get a download script in just one line of console utilities. I could (although it’s actually 8 separate commands split over 12 lines, it’s still executed as one single bash statement). A pretty concise bit of code it is, too:

curl -b cookies.txt -A "Apple iPhone v1.1.3 CoreMedia v1.0.0.4A93" -H "Range: bytes=0-" -o iplayer_download.mov \
  $( \
    curl -i -c cookies.txt -A "Apple iPhone v1.1.3 CoreMedia v1.0.0.4A93" -H "Range: bytes=0-1" \
      $( \
        curl -i -A "iPhone, LOL" -c cookies.txt $1 \
        | grep "pid       :" \
        | cut -d\' -f2 \
        | sed "s/\([0-9a-z]\)/http:\/\/www.bbc.co.uk\/mediaselector\/3\/auth\/iplayer_streaming_http_mp4\/\1/" \
      ) \
    | grep Location \
    | cut -d: -f2,3 \
  )

New BBC Wiki

Wednesday, March 19th, 2008

I’ve created a new wiki all about using BBC content at beebhack.bluwiki.com

In the first 24 hrs it got 1500 page requests and it’s not looking to slow down just yet. I would have hosted it here at Strawp.net but I wanted this to be more community owned than something I would run.

The downside of course is that I really don’t have any detailed information on where any of those hits are coming from…

New blog, new danger

Wednesday, March 19th, 2008

The old Strawp.net blogging engine was one of the first pieces of web software I wrote in PHP and its graceless translation into PHP5 was one of the reasons I almost entirely stopped writing entries. The last two items on there I had to write SQL INSERT statements for just to get them online. It was definitely time to give it both barrels!

RIP Strawp.net News, long live Strawp.net blog!

Edit: I know how lazy it is using the default WordPress theme but I like it!

iPlayer hacks and Car PC

Saturday, March 15th, 2008

I’ve been doing two fun things this week. The first was playing around with the iPlayer again. Last Friday (7th March) the Beeb made the rather confusing move of releasing an iPhone-optimised version of the iPlayer. Now, the iPhone doesn’t support Flash, so it was all H264 over HTTP. You could get to this resource on a predictable URL just by changing your user agent to that of an iPhone. No DRM, no proprietary streaming format, and for a platform which is minority in the extreme, making a mockery of the “big platforms first” defence that the BBC used for rolling out Windows-only versions of iPlayer.

Anyway, a few days after this was all revealed, they “patched” the service, which actually meant they just checked on the “Range” HTTP header as well as the “User-Agent” one. Pretty weak. By the end of that same day, I’d updated my download script, and so had Paul Battley, followed by johnsto who has written an XBMC version of the exploit.

What will Auntie do next? Let the games commence…

I’ve also put a PC into my car this week, written up on the project page.