Bitcrusher / Sky-FM-XBMC-plugin

Other
5 stars 3 forks source link

v2.1.1: add-on fails to start due to problem fetching channel art #3

Open Lx opened 10 years ago

Lx commented 10 years ago

I have just installed this add-on for the first time. When I attempt to open it, this error appears on the screen:

Error Script failed! : plugin.audio.sky.fm

xbmc.log says this:

22:04:24 T:2694739040   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.IndexError'>
                                            Error Contents: list index out of range
                                            Traceback (most recent call last):
                                              File "/storage/.xbmc/addons/plugin.audio.sky.fm/default.py", line 414, in <module>
                                                MusicAddonInstance.start()
                                              File "/storage/.xbmc/addons/plugin.audio.sky.fm/default.py", line 170, in start
                                                streamList = self.customizeStreamListAddMenuitem(jsonList, "") # sending a blank string as listenkey
                                              File "/storage/.xbmc/addons/plugin.audio.sky.fm/default.py", line 226, in customizeStreamListAddMenuitem
                                                self.getChannelArt( channel['id'], "art_" + channel['key'] )
                                              File "/storage/.xbmc/addons/plugin.audio.sky.fm/default.py", line 258, in getChannelArt
                                                xbmcgui.Dialog().ok( ADDON.getLocalizedString(30160), ADDON.getLocalizedString(30161), ADDON.getLocalizedString(30162) + channelartDict[0] )
                                            IndexError: list index out of range
                                            -->End of Python script error report<--

The immediate cause for the error appears to be a lack of elements in the channelartDict list.

The less immediate cause seems to be that the sky.fm webpage has changed since the channelArt_re regex on line 243 of default.py was written. Specifically, there no longer seems to be any occurrences of data-id= in the HTML of the sky.fm home page.

In order to be able to use the add-on in the meantime, I have commented out lines 258 and 259 of default.py:

xbmcgui.Dialog().ok( ADDON.getLocalizedString(30160), ADDON.getLocalizedString(30161), ADDON.getLocali...
xbmc.log( ADDON.getLocalizedString(30160) + " " + ADDON.getLocalizedString(30161) + channelKey + " " +...

(I'm not sure that a dialogue should be shown for each failed channel art fetch anyway, especially since in my case there were 66 failed art fetches at the time that the add-on started.)