Wednesday, 12 November 2008 at 23:03

A while ago, I managed to get my hands on a refurbished Apple TV from the Apple Store. I’m very pleased with it. However, something that has been talked about, but has never materialised, is BBC iPlayer support. It exists for a number other platforms, but it just seems to be taking them a little longer for the ATV.

One evening over a beer, a friend mentioned get_iplayer. It sounded ideal; a command-line way to get iPlayer content onto your computer in a nice (H.264) format. Okay, it’s only designed for a little iPhone screen, but it’s better than nothing. Even the Flash player (at basic quality) stutters in my house due to the shoddy ‘net connection I have, so the smaller file sizes are a bonus too.

The problem is, you have to keep manually importing everything into iTunes for it to appear on the Apple TV. Setting names and video type all the time isn’t my idea of fun, plus it seemed such a waste of the automatic nature of get_iplayer’s PVR functionality. So I wrote some scripts.

iPlayer Import Scripts

My little iPlayer Import scripts are a combination of bash shell scripts and AppleScript, so it’s Mac OS X only, I’m afraid. Sorry, Windows users. They are triggered by get_iplayer and automatically import the completed files, tag them as TV Shows, give them a series title and name (derived from the BBC’s naming) and then dump the downloads into a bin to await automated deletion. It’s all fairly simple – the worst part was figuring out how to get AppleScript and sed and awk to do what I wanted. Thank you to Doug Adams of Doug’s Applescripts for his ‘iTunes & AppleScript Basics’ pages, which helped a lot.

So, you can download them below and try them for yourself. They’re released under ‘give me fair credit and do what you like with them’ and ‘your mileage may vary’ licenses.

Obviously, a big thank you to Phil Lewis for writing get_iplayer, where the clever stuff actually happens.

Download

Latest Version: iTunes iPlayer Import v1.04

01/12/08
Modified again; sometimes the show would not be marked as new after its metadata had been added. The mark as new function now occurs earlier in the script.

26/11/08
There’s a new version out, because iTunes 8.0.2 seems to auto-play everything when imported. Things have been tidied and tweaked a bit, including binning the old files immediately after import.