Configuring get_iplayer

There are lots of ways of setting up get_iplayer. Here’s mine.

It means that filenames work across Windows and Linux, removes underscores from names, never deletes old episodes and downloads episodes into a directory named after the series and names the files with the series’ episode number.

Your own options file is in ~/.get_iplayer or c:usersusername.get_iplayer depending on your operating system.

I have forked Charbot Green

About a year ago Libby Miller wrote Charbot Green, a BBC Radio 4 announcement bot for Twitter. It’s written in JRuby, uses the H2 database and the source code is in SVN here.

A screenshot of CharbotGreen on Twitter

It’s a really great app and I thought I’d have a play, but half-way through the install I realised that setting up an H2 DB server was a step too far, so instead I rewrote it to be a pure Ruby app using the SQLite3 database. Using SQLite3 keeps it a self-contained app in a single directory without the need to run a database server.

You can get the code from GitHub here.

My small changelist looks like this:

  • H2 replaced by SQLite3
  • links to iPlayer use the short form of the URL
  • if available, the subtitle, such as episode number is displayed
  • now a pure ruby app!

I haven’t tested it very hard, just run it up a couple of times, so please do let me know of bugs or feel free to go fork it yourself!

Mai blog! It is back!

So, I finally finished the move from one host to another. It should not have taken as long as it did but after a frustrating night with the nginx config I spent a few days unwinding and catching up with the BBC’s new light entertainment series for Saturday nights, Merlin by watching it on iPlayer. My god I love iPlayer. It’s amazing. Even though I already have a PVR which the wife and I use heavily, iPlayer has still changed how we think about and watch TV. Awesome.

Anyway.

In the process of moving server I also moved from my blog being served from Apache+mod_php to Nginx+fastcgi (in particular I followed these instructions: Perfect Setup: Ubuntu Hardy+Nginx+MySQL5+PHP5+Wordress). I learnt a few things, although I’m sure most lessons will become apparent over the coming weeks. 😉

Firstly, nginx is amazing. In-place binary upgrades; simpler (to me) config files; faster; smaller; less memory overheard. If memory is no object to you, then you’re probably safe staying with Apache2, otherwise I’d recommend the switch.

fastcgi is less good, taking more memory than I’d like, although it’s hard to do an apples-to-apples comparison because of course Apache2 masks the PHP usage. This may also be throwing off the nginx vs. Apache2 comparisons between my servers but only by a small amount I hope.

Another reason I’ve taken to nginx is that the documentation seems to have made a leap that Apache2’s never seems to have managed. That is to say, it is a user-friendly wiki with sections for both user-contributed recipes as well as a complete config reference. Apache’s documentation has always been a source of pain to me, and it’s almost always guaranteed that the answer you’re looking for is on someone’s blog or in a mailing list somewhere rather than closer to the main docs and having some vague authority of being halfway accurate.

Of course, this may just be because Apache2 is now a venerable beast (or at least the docs that also apply to Apache are), but it makes a big difference.

Anyway, I look forward to a world of excitement with my new nginx setup. I have yet to set up proper logging (like filtering 404s and logrotate for specific site logs) and I have a mass of images and videos still to bring over from my old site, plus wordpress maintenance like theme-munging and plugin installation, and at some point it might be nice to actually have a home page…

More on the BBC iPlayer and RTMP

There appears to be some work going on to try and get iPlayer working on the XBox Media Center according to this thread on their forums (thanks for the link, Iain) and although it only seems to make progress up to where I did, it does include this comment from Ian Forrester of backstage.bbc.co.uk (a terribly nice chap who I met at XTech 2007 in Paris, and who as it turns out used to DJ at a club I used to go to in Bristol) We’re happy for people to hack around for non-commercial uses. which is really good to hear.

Additionally, tonight I came across WiidiaPlayer which is built in MTASC, an open-source ActionScript 2.0 compiler written in OCaml and plays back RTMP streams. Wiidiaplayer is open source and that source is on Google Code. My initial tests haven’t been that successful, but they’ve only been ten minutes long 🙂

Downloading from the BBC streaming iPlayer is hard

(this was mostly written on Friday 14th December, although no-one else seems to have stepped up to the plate yet)

The new Flash-based BBC iPlayer streams its content over Adobe’s proprietary RTMP, making it very hard to download the stream and save it for later.

There are some native, commercial, applications to do this on Windows like Replay Media Catcher but as far as I can tell, nothing on Linux. There has been a first-pass MythTV integration but this seems to use an embedded browser window.

snagged iplayer content

Red5 is a Java-based open-source Flash server which also comes bundled with some code for a sample client (download the tarball and then look in src/org/red5/samples/client). It might be possible to use this to download the stream; I haven’t yet tested. There also appear to be some code samples in Ruby and Python lying around, but these look very incomplete.

The URL for the stream is along the lines of this:

rtmp://217.243.192.52:1935/ondemand?_fcs_vhost=cp41752.edgefcs.net&auth=SECRET_KEY&aifp=v001&slist=STREAM_NAME

where both SECRET_KEY and STREAM_NAME come from a file of the name http://www.bbc.co.uk/mediaselector/3/stream/check/iplayer?pid=PID where PID is a BBC Programme ID such as b008h3zq as found on http://www.bbc.co.uk/programmes/ – the base URL for this address is found in the config.xml file linked to from every iPlayer page: http://www.bbc.co.uk/iplayer/emp/xml/config.xml

So this looks hackable, with the most promising chance probably being with Java at the moment.