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.
(2014-04-29, 04:03)exobuzz Wrote: [ -> ]Version 2.5.5 - https://drive.google.com/folderview?id=0...sp=sharing

changes:
* fix for broken thumbnails - thanks to dlake
* fixed thumbnail cache
* regular expression optimisations - thanks to neil
* removed play dialog that caused issues for some users (and wasn't particularly useful).
* harmonise logging - thanks to neil
* fixed episode sorting - thanks to doug
* improved stream selection based on user preferences - thanks to doug

Hi after auto update to 2.5.5, I wasn't able play video and came up with a script error. I tried on both OUYA build and Gotham android build.

The old version 2.5.4 worked fine until it auto updated to new 2.5.5.

_________________________________

[Update}
Please find my debug log below:
http://xbmclogs.com/show.php?id=189907

Thanks!
Well include your log of the error then!
(2014-04-30, 21:36)MilhouseVH Wrote: [ -> ]Well include your log of the error then!

Was about to, didn't have my computer handy just now Big Grin

Log uploaded, post updated with URL
Thanks, some people are a bit more "hit & run" Smile

Looks like it doesn't like the md5 library on Android, iplayer will need updating to use a compatible alternative (hashlib).
@[email protected]: Now that I'm on a PC I can see there are further errors relating to elemtree, probably due to the new thumbnail code. Strange that this works fine on other platforms - I went into Popular -> "Great British Menu: Series 9: Central Fish" without any problem on OpenELEC.

The md5 and Sets deprecation warnings should be eliminated though, is anyone still using Python 2.5.x?
Hi, I'm encountering an error trying to use this plugin - from what I can tell it appears to be a bug, but would anyone mind taking a look at the log to let me know if it's something I'm doing wrong?

I am using v2.5.5 on Android, the BeyondXBMC build. When I go to view any iPlayer program or live stream, it gives me a script error popup. The log is:

Code:
09:18:58 T:1740806696   DEBUG:  - calling plugin iPlayer('plugin://plugin.video.iplayer/','-1','?pid=bbc_one&feed_channel=bbc_one')
09:18:58 T:1740806696    INFO: initializing python engine.
09:18:58 T:1740806696   DEBUG: new python thread created. id=15
09:18:58 T:1837129480   DEBUG: Python thread: start processing
09:18:58 T:1837129480  NOTICE: -->Python Interpreter Initialized<--
09:18:58 T:1837129480   DEBUG:  - The source file to load is /mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/default.py
09:18:58 T:1837129480   DEBUG:  - Setting the Python path to /mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.t0mm0.common/lib:/mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/script.module.socksipy/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.chardet/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.simplejson/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.myconnpy/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.addon.common/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.beautifulsoup/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.pil/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.common.plugin.cache/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.simple.downloader/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.requests/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.urlresolver/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.buggalo/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.mechanize/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.parsedom/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.elementtree/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.requests2/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.pysqlite/lib:/data/data/com.flumpster.xbmc/cache/apk/assets/addons/script.module.metahandler/lib:/:/data/app/com.flumpster.xbmc-1.apk/assets/python2.6/lib/python26.zip:/data/app/com.flumpster.xbmc-1.apk/assets/python2.6/lib/python2.6:/data/app/com.flumpster.xbmc-1.apk/assets/python2.6/lib/python2.6/plat-linux3:/data/app/com.flumpster.xbmc-1.apk/assets/python2.6/lib/python2.6/lib-tk:/data/app/com.flumpster.xbmc-1.apk/assets/python2.6/lib/python2.6/lib-old:/data/app/com.flumpster.xbmc-1.apk/assets/python2.6/lib/python2.6/lib-dynload:
09:18:58 T:1837129480   DEBUG:  - Entering source directory /mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer
09:18:58 T:1837129480   DEBUG: Instantiating addon using automatically obtained id of "plugin.video.iplayer" dependent on version 2.1.0 of the xbmc.python api
09:18:58 T:1837129480   ERROR: /mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/lib/iplayer2.py:7: DeprecationWarning: the md5 module is deprecated; use hashlib instead
                                              import md5
09:18:58 T:1837129480   ERROR: /mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/lib/iplayer_search.py:5: DeprecationWarning: the sets module is deprecated
                                              from sets import Set
09:18:58 T:1837129480  NOTICE: plugin.video.iplayer: Version: 2.5.5
09:18:58 T:1837129480  NOTICE: plugin.video.iplayer: Subtitles dir: /mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/userdata/addon_data/plugin.video.iplayer/Subtitles
09:18:58 T:1837129480  NOTICE: plugin.video.iplayer: (<iplayer2.feed object at 0x70877cf0>, None, 'bbc_one', None, None, None, None, None, None, None, None, None, None, None)
09:18:58 T:1837129480  NOTICE: plugin.video.iplayer: Read playlist for bbc_one...
09:18:59 T:1837129480  NOTICE: plugin.video.iplayer: URL Fetch took 0.26 sec for http://www.bbc.co.uk/iplayer/playlist/bbc_one
09:18:59 T:1837129480  NOTICE: plugin.video.iplayer: Found programme: BBC One London
09:18:59 T:1837129480  NOTICE: Traceback (most recent call last):
09:18:59 T:1837129480  NOTICE:   File "/mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/default.py", line 985, in <module>
09:18:59 T:1837129480  NOTICE:     watch(feed, pid, __addon__.getSetting('playaction') == "0")
09:18:59 T:1837129480  NOTICE:   File "/mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/default.py", line 764, in watch
09:18:59 T:1837129480  NOTICE:     item      = get_item(pid)
09:18:59 T:1837129480  NOTICE:   File "/mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/default.py", line 646, in get_item
09:18:59 T:1837129480  NOTICE:     return p.programme
09:18:59 T:1837129480  NOTICE:   File "/mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/lib/iplayer2.py", line 682, in programme
09:18:59 T:1837129480  NOTICE:     for i in self.items:
09:18:59 T:1837129480  NOTICE:   File "/mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/lib/iplayer2.py", line 55, in result
09:18:59 T:1837129480  NOTICE:     loader(self)
09:18:59 T:1837129480  NOTICE:   File "/mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/lib/iplayer2.py", line 48, in result
09:18:59 T:1837129480  NOTICE:     fn(self)
09:18:59 T:1837129480  NOTICE:   File "/mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/lib/iplayer2.py", line 579, in read_playlist
09:18:59 T:1837129480  NOTICE:     self.parse_playlist(self.playlist)
09:18:59 T:1837129480  NOTICE:   File "/mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/lib/iplayer2.py", line 607, in parse_playlist
09:18:59 T:1837129480  NOTICE:     self.meta['thumbnail'] = tree.find("link[@rel='holding']").attrib['href']
09:18:59 T:1837129480  NOTICE:   File "/home/flumpster/Beyond-XBMC/toolchain/android-14/staging/armeabi-v7a/lib/python2.6/xml/etree/ElementTree.py", line 330, in find
09:18:59 T:1837129480  NOTICE:   File "/home/flumpster/Beyond-XBMC/toolchain/android-14/staging/armeabi-v7a/lib/python2.6/xml/etree/ElementPath.py", line 186, in find
09:18:59 T:1837129480  NOTICE:   File "/home/flumpster/Beyond-XBMC/toolchain/android-14/staging/armeabi-v7a/lib/python2.6/xml/etree/ElementPath.py", line 176, in _compile
09:18:59 T:1837129480  NOTICE:   File "/home/flumpster/Beyond-XBMC/toolchain/android-14/staging/armeabi-v7a/lib/python2.6/xml/etree/ElementPath.py", line 93, in __init__
09:18:59 T:1837129480  NOTICE: SyntaxError: expected path separator ([)
09:18:59 T:1740806696   DEBUG: ------ Window Init (DialogKaiToast.xml) ------
09:18:59 T:1740806696   DEBUG: Window DialogKaiToast.xml was already loaded
09:18:59 T:1740806696   DEBUG: Alloc resources: 0.00m
09:18:59 T:1837129480    INFO: Python script stopped
09:18:59 T:1740806696   DEBUG: waiting for python thread 15 (/mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/default.py) to stop
09:18:59 T:1740806696   DEBUG: python thread 15 (/mnt/sdcard/Android/data/com.flumpster.xbmc/files/.xbmc/addons/plugin.video.iplayer/default.py) destructed
09:19:04 T:1740806696   DEBUG: ------ Window Deinit (DialogKaiToast.xml) ------
09:19:24 T:1740806696   DEBUG: SECTION:UnloadDelayed(DLL: libImageLib-arm.so)
09:19:24 T:1740806696   DEBUG: Unloading: libImageLib-arm.so

The suspicious part, to me, is "NOTICE: SyntaxError: expected path separator ([)" - but I can't think of any way I could work around this in settings?

Thanks in advance![/code]
it's a problem with some code that was fine on my python 2.7.x elementtree that is causing errors on earlier versions. I will look into it when I get a chance - in the meantime, you can use the previous version of the plugin (and put up with broken thumbnails).

basically the syntax I was using is new in elementtree 1.3 which was shipped with python 2.7. I will need to revert to using a regular expression (which was in the original patch, which I changed), or some compatible elementtree syntax
Ah, OK. Yep, 2.5.4 is working for me, thank you. Broken thumbnails can certainly be put up with, as compared to broken streaming! :-)
without having to read through all 158 pages, can someone tell me if the iplayer can work with Gotham beta 2?
I keep getting a script error when I try to open a channel
Yes. The iplayer add on works with Gotham. I've had it on all the betas and now coming fine with RC1
iplayer v2.5.6 released - https://drive.google.com/file/d/0B_knGio...sp=sharing

changes:
* avoid md5/sets deprecated warnings on Python 2.6+ - thanks to neil
* don't keep resume points during first 5% or last 95% of stream - thanks to neil
* switch extraction of thumbnail from xml to regular expression due to elementree <1.3 lacking xpath @attrib
2.5.6 crashes. "import xbmc" missing in /lib/iplayer2.py (at least that fixes it for me).
(2014-05-03, 22:07)bosel Wrote: [ -> ]2.5.6 crashes. "import xbmc" missing in /lib/iplayer2.py (at least that fixes it for me).

What was the exact error, as xbmc wasn't imported by iplayer2.py in 2.5.5 either (or earlier versions). Could be due to the logging change.
(2014-05-03, 22:07)bosel Wrote: [ -> ]2.5.6 crashes. "import xbmc" missing in /lib/iplayer2.py (at least that fixes it for me).

The damn thing is still broken. Ever since 2.5.5 iPlayer has not worked when configured with a proxy. 2.5.6 hasn't resolved the issue either.

21:27:11 T:139701117773568 NOTICE: -->Python Interpreter Initialized<--
21:27:12 T:139701117773568 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.NameError'>
Error Contents: global name 'xbmc' is not defined
Traceback (most recent call last):
File "/storage/.xbmc/addons/plugin.video.iplayer/default.py", line 19, in <module>
import iplayer2 as iplayer
File "/storage/.xbmc/addons/plugin.video.iplayer/lib/iplayer2.py", line 114, in <module>
http = get_httplib()
File "/storage/.xbmc/addons/plugin.video.iplayer/lib/iplayer2.py", line 104, in get_httplib
utils.log("Using proxy: type %i rdns: %i server: %s port: %s user: %s pass: %s" % (proxy_type, proxy_dns, proxy_server, proxy_port, "***", "***"),xbmc.LOGINFO)
NameError: global name 'xbmc' is not defined
-->End of Python script error report<--
21:27:12 T:139702461491008 ERROR: GetDirectory - Error getting plugin://plugin.video.iplayer/?content_type=video
21:27:12 T:139702461491008 ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.video.iplayer/?content_type=video) failed
21:27:12 T:139701117773568 NOTICE: Thread BackgroundLoader start, auto delete: false

When I remove the proxy information in add on settings, everything is fine (well I can browse the listings but can't play from my IP as am outside the UK. Routing my XBMC IP over my GRE IPSEC connection fixes the issue).
@toph3r, bosel: Yep sorry, that's an error I introduced with the logging change in 2.5.5 (I'm scratching my head wondering how I missed that). Just add "import xbmc" at the top of iplayer2.py and you should be OK. I've submitted a patch to fix it in the next release.

Edit: Eugh, I see why it was kind-of working - the call to "import xbmc" occurs very late in line 1076 of iplayer2.py, which in some cases is too late for calls to utils() that proceed to reference a property of the yet to be loaded xbmc module. Add "import xbmc" at the beginning then all calls to utils() will work - you could remove line 1076 but there's no harm importing it twice.