Kodi Community Forum
[RELEASE] iPlayer - BBC Video and Music Plugin (UK only!) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
+---- Thread: [RELEASE] iPlayer - BBC Video and Music Plugin (UK only!) (/showthread.php?tid=51322)



- jackanddougal - 2010-04-30

OK,here is a patch to support various bit rates with akamai. You'll have to undo the change you have made to the settings files as well.

Code:
--- IPlayer-exobuzz-529/lib/iplayer2.py    2010-04-28 14:21:38.000000000 +0100
+++ IPlayer-Active/lib/iplayer2.py    2010-04-30 20:23:18.705671038 +0100
@@ -396,16 +396,16 @@
         """ True if this stream is 'signed' for the hard-of-hearing. """
         return self.alternate == 'signed'
    
-    @property
-    def mediaselector_url(self):        
-        return "http://www.bbc.co.uk/mediaselector/4/mtis/stream/%s/iplayer_streaming_h264_flv/akamai" % self.identifier        
-    @property
-    def media(self):
+    def mediaselector_url(self,suffix):        
+        if suffix == None:
+            return "http://www.bbc.co.uk/mediaselector/4/mtis/stream/%s" % self.identifier        
+        return "http://www.bbc.co.uk/mediaselector/4/mtis/stream/%s/%s" % (self.identifier, suffix)
+
+    def medialist(self,suffix = None):
         """
         Returns a list of all the media available for this item.
         """
-        if self.medias: return self.medias
-        url = self.mediaselector_url
+        url = self.mediaselector_url(suffix)
         logging.info("Stream XML URL: %s", url)
         xml = httpget(url)
         tree = ET.XML(xml)
@@ -413,6 +413,18 @@
         medias = []
         for m in tree.findall('media'):
             medias.append(media(self, m))
+        return medias
+
+    @property
+    def media(self):
+        """
+        Returns a list of all the media available for this item.
+        """
+        if self.medias: return self.medias
+        medias = []
+        for m in ['iplayer_streaming_h264_flv_hd/akamai', 'iplayer_streaming_h264_flv_high/akamai', 'iplayer_streaming_h264_flv/akamai', 'iplayer_streaming_h264_flv_lo/akamai', 'iplayer_streaming_h264_flv_vlo/akamai']:
+            medias.extend(self.medialist(m))
+        medias.extend(self.medialist())
            
         self.medias = medias
         if medias == None or len(medias) == 0:

P.S. Thanks exobuzz for your work getting this working again.


- spicemuseum - 2010-04-30

exobuzz Wrote:If you have done something like modifying the URL bit depending on the chosen quality you can get the other qualities too with a different path.

iplayer_streaming_h264_flv_high is 1500 (which I guess you already worked out)
iplayer_streaming_h264_flv_hd I think is 3200kbit. and so on.

note that it seems only the akamai streams dont work from the previous mediaselector xml that returns all stream data. the others are fine.

I'm currently working on the xbox build of xbmc. I have built in polarssl, and managed to get the new libRTMP built. I need to do some debugging though, as currently it breaks with a memory read from 0x0 which isn't quite what I want ;-)
LOL.

exobuzz Wrote:When/If I get this to work, it will bring all the new features of libRTMP to the xbox, including automatic swf hash generation, and support for limelight rtmpt streams and so on (as well as lots of other improvements im sure)
Great progress. I wish I had the time to do this, looking forward to the outcome.

BTW, I recommend JackAndDougal's patch to allow higher resolutions (or rather flexible resolution selection). It works on my Revo.


- exobuzz - 2010-05-01

Just a quick update. I have the new libRTMP working now on the XBOX. I'm still tweaking a few things here and there, but the problems I had before with it crashing are fixed. Fast forwarding doesn't work, but I noticed this doesnt seem to either with libRTMP patches on linux, so I have asked about that on the trac bug. Thanks again to highlandsun for the polarssl work.


- exobuzz - 2010-05-01

FYI: http://trac.xbmc.org/ticket/9146


- gregherbet123 - 2010-05-01

exobuzz Wrote:If the python http stuff respects the proxy settings it should be ok.

Thanks.
Sadly, initial investigations indicate that it actually doesn't. I didn't look too hard into this though as I have access to a VPN as well so have headed down that route instead.

exobuzz Wrote:Basically, you only need the proxy to get the auth key from the bbc. The actual data streams from akamai/limelight do not need to be proxies for example.

I can't tell you how useful this little tidbit has been, however Smile Thanks for the tip, I have everything working now!


- exobuzz - 2010-05-03

Just to give an update. I have everything working for an xbox build now, so that the hash is generated as needed from the swf file and also including all the other features that the new libRTMP build brings (rtmp over http and more). Currently though seeking in videos is not working as I need to build a new ffmpeg libavcodec.dll, and as there was no documentation in the sources, i had to sort of work out how to do it. I'm almost there, but I am hoping than the current XBOX maintainer will include my patches in the build (with any improvements/optimisations).

Right now these patches are also not in the linux build. they have been doing major reworking of many aspects (the plugin/addons stuff), and i assume the current patch queue will be looked at after this. Or at least I hope. There has been no suggestion that they won't or can't include the new libRTMP at least.

I'll keep you posted.


- highlandsun - 2010-05-03

Hm, the seek patch is for libavformat, not libavcodec. But I dunno how the Xbox build lays things out...

As for librtmp itself, I had contacted the XBMC team about it first, before I posted the patch to trac. They sounded pretty interested in adopting the code, otherwise I wouldn't have bothered to work on the patch. I suspect it will go in once other changes have settled down.


- kalross - 2010-05-03

I have Get_iPlayer running on a server with a XBOX and Linux client. Is it crippled now? Can I update RTMP and get it working again?

Ta


- Hitcher - 2010-05-03

I'd just like to say that all the work on getting running again is really appreciated.


- exobuzz - 2010-05-03

highlandsun Wrote:Hm, the seek patch is for libavformat, not libavcodec. But I dunno how the Xbox build lays things out...

Just a thinko. Same thing for me, as I still need to get the ffmpeg stuff built for this Smile


- spicemuseum - 2010-05-03

kalross Wrote:I have Get_iPlayer running on a server with a XBOX and Linux client. Is it crippled now?
No, but some streams you need to retry starting them several times before they play on XB0X. I have the same set-up, but I've moved one of my XB0Xes over to the exobuzz build version (eliminating the need for get_iplayer), and in my view it works better.

I still use get_iplayer web interface for occasionally recording stuff independently of XBMC iPlayer, so I'll leave that running on my server

I'm looking forward to a full and proper exobuzz XB0X XBMC build with a properly worked swf verification hash, patched rtmp library (polarssl style) &c &c...


- exobuzz - 2010-05-04

I've now built new xbox ffmpeg dlls with the patch from highlandsun for xbox. I also upgraded the version of ffmpeg the xbox was running from. Seeking now works great.

Just got to package it all up, along with an iplayer script with a few changes. This will probably happen later today or tomorrow as I have to get some sleep now!


- spicemuseum - 2010-05-04

exobuzz Wrote:I've now built new xbox ffmpeg dlls with the patch from highlandsun for xbox. I also upgraded the version of ffmpeg the xbox was running from. Seeking now works great.

Just got to package it all up, along with an iplayer script with a few changes. This will probably happen later today or tomorrow as I have to get some sleep now!
Fantastic work, but you can't leave us all in suspenders...!


- exobuzz - 2010-05-04

Sorry ;-)

Actually there is going to be a small delay Sad. There is an issue with the rtmpt streams that limelight uses. debugging now.


- exobuzz - 2010-05-05

ok. Finally I can ask you to try some code.

Please try out the xbmc build here:
http://malus.exotica.org.uk/~buzz/xbmc/xbox/xbmc-r29407-librtmp.zip
with the iplayer here
http://malus.exotica.org.uk/~buzz/xbmc/IPlayer.zip

the Iplayer is similar to the previous one + the patches jackanddougal made with a few modifications. I removed the mobile quality and left in 480/800/1500/3200 kbit. Note that the current functionality isn't ideal as we grab authentication keys/stream xml 5 times when a file is selected. It would be better if the standard xml was used, but when an akamai stream was chosen, a new authentication key was grabbed corresponding to the quality. That is how the flash player works. I'm not all that familiar with this code though and the OO style, so it would be great if the original author was to come back and tweak a little before moving on :-)

The new version also has an additional prefs bit to chose whether you want
akamai or limelight streams. limelight uses rtmpt which was not supported before but we can use now. It doesn't use any swf verification either.

hash keys are cached in Q:\UserData\cache.

The plugin works fine on linux also - the xbox/linux versions with the libRTMP patches function the same.

There might be a few more things I didn't mention, so please just let me know how you get on. Many thanks.