iPlayer downloads temporarily broken
It’s fixed now. See below.
The iPlayer appears to have changed somehow. As soon as I can get hold of a session trace, I’ll work out what’s changed and fix my downloader.
In the meantime, here’s a snippet from the iPlayer source code to amuse you:
var _uaMatch = {
'apple-i-family' : /(iphone|ipod)/,
'nokia-s60-webkit-family': /(n95|n96|n78)/,
'samsung-win-mobile': /sgh-i900/ //"SAMSUNG -SGH-i900/1.0 Opera 9.5"
};
So you can now use the iPlayer if you’re using an iPhone or an iPod Touch, or a Nokia N95/N96/N78, or a Samsung SGH-i900. That’s it. I wonder how long they can keep up this piecemeal approach to mobile support before it overwhelms them. If they’d only used open standards … Ironically, of course, they are using open standards, just obfuscated.
I’ve really got to get hold of an iPod Touch. It would make all this reverse engineering so much easier. Anyone got an old one going spare?
Update: Apparently it’s genuinely broken. Even from a real iPhone.
Update 2: It’s broken for some people using iPhones. Not sure what’s going on.
Update 3: There was a small change to the iPlayer that broke downloads. Thanks in no small part to Mike Trim, I’ve published a fix. It will be available on the project page shortly.
2008-11-27 21:44 UTC. Comments: 14.
Mike Trim
Wrote at 2008-11-27 23:07 UTC using Firefox 3.0.4 on Linux:
I’ve got it working again—patch at http://gist.github.com/29856Paul Battley
Wrote at 2008-11-27 23:15 UTC using Firefox 3.0.4 on Linux:
Thanks, Mike! I’ve independently checked in an almost identical fix – but it was your pointer on the redirect that enabled me to do it.Phil Lewis
Wrote at 2008-11-27 23:22 UTC using Firefox 3.0.4 on Linux:
@Paul,Is this just a web scrape issue maybe. I cannot reproduce the problem with get_iplayer – do you have a pid which is specifically broken I can test with. Thanks
Phil
Irregular Shed
Wrote at 2008-11-28 10:34 UTC using Firefox 3.0.1 on Windows XP:
Regarding the source code snippet, I spotted this a while ago when I started wading through the code of the N96 client. The stupid thing is, despite supporting the N95 and N78 within the code, you can’t actually get the widget that contains it because there’s a useragent check that restricts the download to N96s.More on this blog post: http://blogger.twindx.co.uk/2008/10/more-iplayer-shenanigans.html
Duncan Smart
Wrote at 2008-11-28 11:01 UTC using Safari 525.19 on Windows Vista:
I’ve implemented a .NET client just for fun which was helped enormously by looking at what your Ruby code was doing – so thanks for sharing.Anyway, I noticed that you don’t appear to need to do the request_iphone_page (to get the BBC-UID cookie) or the request_image_bugs steps any more. Has the beeb wised up to the fact that the obfuscation is futile now?
evan
Wrote at 2008-11-29 10:27 UTC using Firefox 3.0.4 on Mac OS X:
YES! It works. Thanks Paul and Mike.luddite
Wrote at 2008-11-30 14:52 UTC using Firefox 3.0.4 on Windows XP:
I have no idea what you clever people are always talking about ( Ruby code, obfuscated open standards, ..?!? ), but I love the iPlayer hack more than chocolate and if ever the need arises I am perfectly willing to trade my first born child or grandmother for it.I hope I didn’t break any rules by not posting anything helpful or constructive, but I just wanted to let you know much your work is appreciated.
snafu
Wrote at 2008-11-30 22:18 UTC using Firefox 2.0.0.17 on Linux:
Thanks for the fix guys. Much appreciated…Alan
Wrote at 2008-12-01 10:29 UTC using Firefox 3.0.4 on Windows XP:
Thanks for a brilliant application: this is fantastic. I’ve downloaded a few videos for watching on my iPod, but I’ve found a few that don’t seem to work:http://www.bbc.co.uk/iplayer/episode/b00ftvvc/Spooks_Series_7_Episode_3/
http://www.bbc.co.uk/iplayer/episode/b00dzwq6/Merlin_The_Poisoned_Chalice/
http://www.bbc.co.uk/iplayer/episode/b00dw376/Merlin_The_Mark_of_Nimueh/
http://www.bbc.co.uk/iplayer/episode/b00drmbs/Merlin_Valiant/
http://www.bbc.co.uk/iplayer/episode/b00dq8tn/Merlin_The_Dragons_Call/
All the other episodes in the same two series seem to work. Any idea what might be happening?
Chris
Wrote at 2008-12-03 21:03 UTC using Safari 525.26.12 on Mac OS X:
@AlanI don’t know about Merlin, but the Spooks episode has been broken for ages (or was never valid). I can’t remember the exact phrasing, but my iPod Touch tells me that the episode is not available. I’ve used both the published “contact us” link and the relevant BBC forum to alert them to this, but they don’t seem inclined to fix it…
In general though, are things broken again? I’ve just installed 0.1.14 and it tells me that “There is no page for this program” for everything I’ve tried.
The one I’m interested in:
http://www.bbc.co.uk/iplayer/episode/b00fyl5z/Horizon_Do_You_Know_What_Time_It_Is/, by URL or ID
Chris
Wrote at 2008-12-03 21:47 UTC using Safari 525.26.12 on Mac OS X:
Hmm, actually it seems like that was down to a broken installation. Not sure what exactly happened, but sudo’d both steps (on OS X) and the installation went into /usr/lib (and didn’t work – require statements failed). Cleaned up, did it again (sudo only for final step) and it went into /usr/local/lib and worked.MaFt
Wrote at 2008-12-19 21:15 UTC using Firefox 3.1b2 on Mac OS X:
v3.0 is great, however, after 8 successful downloads earlier today i reloaded the program and it now fails to download anything… even stuff i’d already downloaded earlier today. is there any logs i can email to try help you out?thanks
MaFt
nom
Wrote at 2008-12-23 16:30 UTC using Internet Explorer 7.0 on Windows XP:
Very good app, thanks to you !!Been using it to download onto windows.
Looking at trying to automate it, but I have noticed that the downloads often stop with errors, but pressing download again makes them continue.
Any chance of an automatic resume feature please?
Then one can just leech away at the BBC :)
Nick Bailey
Wrote at 2008-12-29 20:26 UTC using Konqueror 3.5 on Linux:
Hi Paul, I noticed iplayer-dl 0.1.14 stopped working for me today (as per this RSS item I expect) and tried the svn copy: it says./lib/iplayer/metadata.rb:33:in `versions’: undefined method `attributes’ for nil:NilClass (NoMethodError)
Line 33 is:
versions[alternate.attributes[‘id’]] = version_pid
and alternate is the result of an XPath call.
Sorry I can’t fix it. I’m a python sorta guy, and this Ruby stuff is a bit out of my ken right now (I don’t even know how to make it print stuff!)
Thanks so much for all your work though; as a Linux fundamentalist, your script’s an absolute lifeline!