Kodi Community Forum

Full Version: [RELEASE] iPlayer - BBC Video and Music Plugin (UK only!)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
you can get my prebuilt ubuntu binaries here

http://malus.exotica.org.uk/~buzz/xbmc/linux/

there is source there too, incase you need to compile it (if for example there are dependency issues). You can also get the patches out of that source tree, as they are in debian/patches and are managed by quilt.

quilt pop would remove the patch
quilt push would apply it.

--

PS. I have updated the IPlayer plugin again. I put the 400kbit fallback back in, as i noticed a few recent HD recordings only had 3200 and 400. (Perhaps they are queued to be encoded, or it's how the beeb want it). I also did some code cleanups.

PPS. My update patches for xbox dvdplayer ffmpeg got into the main xbox branch. Hopefully the libRTMP stuff will be next (thanks arnova).
Exobuzz, this is fantastic news. Well done. Is there any chance you could compile a Windows version or is that a completely different ball game?
Hi exobuzz. Thanks so much for putting these patches and builds together - my xbox was a little lonely without the Iplayer.

If I may, I have an off-topic question (not Iplayer related but to do with libRTMP)

Thanks to your libRTMP patch I though I'd look into getting a 4oD plugin working. I'm just stuck on one thing though. How do I generate the auth key?

I can get a stream to play from the xbox (from my plugin generated url) as long as I supply an authkey nicked from getflv. It is only valid for one file and seems to expire in about 5 minutes.

Example built rtmpe stream (this worked at some point before the authkey expired!):
Code:
rtmpe://ak.securestream.channel4.com:1935/4oD/?ovpfv=1.1&auth=[b]da_a1dVaYdXaEcXcWbfdwdibdbncBakajbU-bl76LM-eS-gAT-kttDkpt7swpem8srnunsr3k2tTqvnsq7kYsckFtJsDphmMsfn6ndrbk3sfp8noqdkVtSkIt9sCoem2sw[/b]&aifp=v002&slist=assets/CH4_08_02_16_48398023001001_001.mp4 playpath=mp4:assets/CH4_08_02_16_48398023001001_001.mp4 swfurl=http://www.channel4.com/static/programmes/asset/flash/swf/4odplayer-4.49.7.swf swfvfy=true flashver=10,0,42,34 conn=Z: pageurl=http://www.channel4.com/programmes/how-i-met-your-mother/4od#3068826 app=4oD/?ovpfv=1.1&auth=[b]da_a1dVaYdXaEcXcWbfdwdibdbncBakajbU-bl76LM-eS-gAT-kttDkpt7swpem8srnunsr3k2tTqvnsq7kYsckFtJsDphmMsfn6ndrbk3sfp8noqdkVtSkIt9sCoem2sw[/b]&aifp=v002&slist=assets/CH4_08_02_16_48398023001001_001.mp4
This is How I Met Your Mother - Episode: As Fast as She Can

I can only get a valid authkey from getflv (closed source). I have yet to replicate it's generation with rtmpdump.

All I could find in the Iplayer code was:
Code:
auth = conn.get('authString')
I tried tracing it back but the structure of the coding is beyond me! I also couldn't find any other reference to authString anywhere. Could you provide a similar piece of code that would work for my plugin? I'd be extremely grateful.

Here's my messy plugin (lots of commented out code, unoptimised etc) for your perusal: 4oD_20100517_2253.rar

A couple of extra notes:
  • You can resume the RTMPE stream!
  • Buffering seems to be rubbish on the xbox - the video bitrate doesn't seem any greater than the beeb (800kbps stream) but it drains the cache in 5 seconds and takes 10-20 to fill it Sad

Please let me know if this shouldn't be here an I'll create a new post.Smile
Edit: I should have done - New Post here.
THISWEB Wrote:Exobuzz, this is fantastic news. Well done. Is there any chance you could compile a Windows version or is that a completely different ball game?

This would be great because it's totally beyond me. Wink
eddebaby Wrote:Thanks to your libRTMP patch I though I'd look into getting a 4oD plugin working. I'm just stuck on one thing though. How do I generate the auth key?

The auth key will either be generated from a user/password or be given by the service when a request for a file is made. For the IPlayer the auth keys are given in some xml provided by the bbc.
exobuzz Wrote:The auth key will either be generated from a user/password or be given by the service when a request for a file is made. For the IPlayer the auth keys are given in some xml provided by the bbc.

Thank you. I guess 'authString' is an XML field then. No wonder I couldn't find it in the code. The problem is the token field given in the xml file from 4oD is drastically different in format to the authtoken used in the rtmpe stream.

XML <token> field (http://www.channel4.com/programmes/how-i...et/3067315)
Code:
<token>MlLH/9DMq8EDwTI0vQuuk+B1knpSn2QUXDrV8OHQ86cX1NG1JLH21/TA4aChNrRT2Z+5Lu42Bf0A
Kkr0QRj862ADJt+EoV8kdRdxMmUANIlj1H2Ghvpwc7BNOpAyhUqT2OJSTBpaL8iwuYPprFkyPej2
52f6fZbGEI3QDIZY6AKTwlH14FHhLA==
</token>

Example actual authtokens:
Code:
da_a1dVaYdXaEcXcWbfdwdibdbncBakajbU-bl76LM-eS-gAT-kttDkpt7swpem8srnunsr3k2tTqvnsq7kYsckFtJsDphmMsfn6ndrbk3sfp8noqdkVtSkIt9sCoem2sw
da_cBb0bfbmdFbuaodPcPb0aLc4aLdka1bZ-bl78Zd-eS-kyO-pWmyl2k7oyldlxmnrVparJkqnIl2r4mvpCmzlnjbosl4kcmwr8qDr3k3m8lZrUmep3l9k8kZoWkelYmu

Any ideas? Does it need to be decrypted?
Could easily need to be modified in some way.

Is there any other software that has the source that can stream them like get_iplayer for example? If so, worth a check. Also worth snooping traffic when playing them in the browser, so see what is sent/received to make sure nothing has been missed.
THISWEB Wrote:Exobuzz, this is fantastic news. Well done. Is there any chance you could compile a Windows version or is that a completely different ball game?
+1 Smile
Sneeka Wrote:+1 Smile

I've not looked at a windows build. I guess I could do it, but obviously as it's not a version I use I have a little less motivation. I'll think about it Smile (the rtmp stuff should make it into trunk soon.. although I don't know when).
exobuzz Wrote:Could easily need to be modified in some way.

Is there any other software that has the source that can stream them like get_iplayer for example? If so, worth a check. Also worth snooping traffic when playing them in the browser, so see what is sent/received to make sure nothing has been missed.

wireshark hadn't really turned up very much, but I just gave URL Snooper a go and after checking all of the urls from the 4oD server this caught my eye:
http://www.channel4.com/static/global/js...macsha1.js

It looks like it's creating the auth key, hopefully from the token in the xml. I'm pretty new to javascript but hopefully the answer is in there somewhere. I'm too tired now - didn't get to sleep last night.Confused Hopefully tomorrow will bring results. Thanks for the pointers!

Oh and it looks like the current get_iplayer only works with the BBC and no other sources.
Please can you start a new thread on this and we can continue there?
Also this seems to the original more readable version of the file

http://pajhome.org.uk/crypt/md5/sha1.html

btw the token looks base64 encoded to me. When decoded it gives 136 bytes of data. However we need to see how that javascript sha1 code is used because this 136 bytes might consist of a key and some data that we need to process for example. I'm don't know that much about cryptography stuff I'm afraid.

PS. the code which calls the javascript sha1 stuff is in /static/programmes/js/controller/brand/catchup.js. I can't even say for sure though whether this is directly linked to the token in the xml or not or some other stuff. But it's a start.
Can anyone else confirm if the bottom 2cm of any iPlayer programs look 'stretched' ? - or if it's just me ?

Also... is it my ears or does there seem to be huge variations in audio volume ? - I'm constantly adjusting the TV volume as it switches between music and conversation. It sounds like it could do with some decent compression on there. Lastly.... occasional 'warbling' audio artifacts... is it just the choice of video stream that dictates the quality of the audio signal ?

Big thanks to exobuzz for getting this working again. You're a star !!
Just installed the latest exobuzz xbmc and iplayer plugin and am please to find that it's working like a dream. I had an older exobuzz build installed and whilst it played most, there were some programs that wouldn't play. An example is the latest episode of Doctor Who - Amy's Choice, which yesterday wouldn't play with an older build and today, with the new build, it plays fine.

exobuzz I would like to sincerely thank you for all the effort you have put into this. For a while I thought that this wouldn't get fixed, as I guessed that there is probably not that many xbox xbmc installs remaining, so I am so glad that you have done this.
aneng Wrote:Can anyone else confirm if the bottom 2cm of any iPlayer programs look 'stretched' ? - or if it's just me ?
I can confirm that I get the same.
I'm guessing the bottom portion is only related to the way ffmpeg is decoding the stream. I don't think you are missing data. Just zoom in. anyway. im extremely happy if with my latest builds this is the only problem! success ;-)