divingmule / plugin.video.ustream

XBMC Add-on
GNU General Public License v2.0
5 stars 8 forks source link

Error parsing HTML #2

Open dghodgson opened 11 years ago

dghodgson commented 11 years ago

I'm not familiar with Python or your code base, but (correct me if I'm wrong) it looks to me like your plugin is no longer properly parsing the HTML on Ustream's wesbite. I'm running XBMC 13 on Ubuntu 12.04.

This is the error that shows up in my logs:

17:07:25 T:139993744770816  NOTICE: [addon.ustream-0.0.1]: Mode: 2
17:07:25 T:139993744770816  NOTICE: [addon.ustream-0.0.1]: URL: /PlayStation
17:07:25 T:139993744770816  NOTICE: [addon.ustream-0.0.1]: Name: PlayStation Live - English [Live]
17:07:25 T:139993744770816  NOTICE: [addon.ustream-0.0.1]: amf_url: http://cgw.ustream.tv/Viewer/getStream/1/443086.amf
17:07:25 T:139993744770816   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
     - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
    Error Type: 
    Error Contents: 1
    Traceback (most recent call last):
      File "/home/daniel/.xbmc/addons/plugin.video.ustream-master/default.py", line 396, in 
        get_channel_id_from_html(url)
      File "/home/daniel/.xbmc/addons/plugin.video.ustream-master/default.py", line 151, in get_channel_id_from_html
        resolve_url(channel_id)
      File "/home/daniel/.xbmc/addons/plugin.video.ustream-master/default.py", line 208, in resolve_url
        amf_data = get_amf(stream_id)
      File "/home/daniel/.xbmc/addons/plugin.video.ustream-master/default.py", line 197, in get_amf
        amf_data = remoting.decode(make_request(amf_url)).bodies[0][1].body
      File "/home/daniel/.xbmc/addons/script.module.pyamf/lib/pyamf/remoting/__init__.py", line 626, in decode
        target, payload = _read_body(stream, decoder, strict, logger)
      File "/home/daniel/.xbmc/addons/script.module.pyamf/lib/pyamf/remoting/__init__.py", line 459, in _read_body
        data = decoder.readElement()
      File "/home/daniel/.xbmc/addons/script.module.pyamf/lib/pyamf/codec.py", line 338, in readElement
        return func()
      File "/home/daniel/.xbmc/addons/script.module.pyamf/lib/pyamf/amf0.py", line 316, in readObject
        obj.update(self.readObjectAttributes(obj))
      File "/home/daniel/.xbmc/addons/script.module.pyamf/lib/pyamf/amf0.py", line 299, in readObjectAttributes
        obj_attrs[key] = self.readElement()
      File "/home/daniel/.xbmc/addons/script.module.pyamf/lib/pyamf/codec.py", line 338, in readElement
        return func()
      File "/home/daniel/.xbmc/addons/script.module.pyamf/lib/pyamf/amf0.py", line 316, in readObject
        obj.update(self.readObjectAttributes(obj))
      File "/home/daniel/.xbmc/addons/script.module.pyamf/lib/pyamf/amf0.py", line 299, in readObjectAttributes
        obj_attrs[key] = self.readElement()
      File "/home/daniel/.xbmc/addons/script.module.pyamf/lib/pyamf/codec.py", line 338, in readElement
        return func()
      File "/home/daniel/.xbmc/addons/script.module.pyamf/lib/pyamf/amf0.py", line 243, in readMixedArray
        obj[key] = attrs[key]
    KeyError: 1
    -->End of Python script error report<--
17:07:25 T:139994812479360   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.ustream/?url=%2FPlayStation&mode=2&name=PlayStation+Live+-+English+%5BLive%5D&iconimage=http%3A%2F%2Fstatic-cdn1.ustream.tv%2Fi%2Fexplore%2Fcustom%2F4%2F4%2F3%2F0%2F443086%2F443086_channel_en_US_wide%2C192x108%2Cr%3A1361397586.jpg]
divingmule commented 11 years ago

Looks more like an issue with pyamf decode. I can't seem to reproduce the error with XBMC 12, Ubuntu 12.04 or Windows 7.

dghodgson commented 11 years ago

I forgot that I had installed the nightly build PPA for XBMC on my media center. However, even after I removed XBMC and the nightly PPA, added the stable PPA, and installed XBMC 12.0, I'm still getting the same error.

To reproduce the error, I simply go to my video addons, select Ustream, select the "Games" category, and select "Introducing the PlayStation 4 [Live]".

Previously I was selecting the live stream of Sony's press conference where they announced the PS4 yesterday, and I received the same error. However, I don't seem to get this with every stream. Some streams seem to work just fine (for example, "StuffWeLike: Best of PlayStation [Live]").

divingmule commented 11 years ago

Yeah, I can confirm. For some reason in XBMC, pyamf.remoting.decode is failing on that stream.

In Idle(python console) it works as expected.