[RELEASE] Sickbeard XBMC - Control Sickbeard from XBMC
(2015-01-27, 17:40)wripet Wrote: I am getting this error on 1.0.10 from the SB repo

Code:
16:37:10 T:139726006769408   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.ValueError'>
                                            Error Contents: substring not found
                                            Traceback (most recent call last):
                                              File "/home/main/.kodi/addons/plugin.program.sickbeard/default.py", line 6, in <module>
                                                import resources.lib.settings
                                              File "/home/main/.kodi/addons/plugin.program.sickbeard/resources/lib/settings.py", line 96, in <module>
                                                __APIKey__ = GetAPIKey(__ip__, __port__, __ssl_bool__, __username__,__password__, __custom_url__)
                                              File "/home/main/.kodi/addons/plugin.program.sickbeard/resources/lib/settings.py", line 54, in GetAPIKey
                                                api_index = api_line.index("value=\"")+7
                                            ValueError: substring not found
                                            -->End of Python script error report<--
16:37:10 T:139725880944384   ERROR: GetDirectory - Error getting plugin://plugin.program.sickbeard/

I'm on Kodi and using the SickRage fork. Any ideas?

I came across this same issue trying to get this addon working with SickRage BRANCH: (master) / COMMIT: (42b8d5a9c71c87fcde301967b6254ef08c3093ac) and Kodi 15.0 Alpha2.

My solution was to alter the addon code after it was installed. The error messages you are showing are due to the addon not being able to scrape the SickRage General webpage to find the API Key. Instead my fix is to add the API Key entry to the addon config settings. As well as fix several errors in the addon and modify the URL's to get the poster images working.

Here are my notes that fixed these issues for me:

Code:
Edit settings.py
- Allow for manual entry for API Key value.
- Does not run on SickRage due to the hackish scraping of the webpage to get the API Key.
- On SickRage the API Key is on the second tab of the webpage, and not in the same screen location as SickBeard.
- Adding the API Key to the settings page solves this problem.  UI's are always subject to change, and scraping the webpage is a point of failure.

Add line 68
__api_key__=__addon__.getSetting('API Key')
Replace line 96
__APIKey__ = GetAPIKey(__ip__, __port__, __ssl_bool__, __username__,__password__, __custom_url__)
with
__APIKey__ = __api_key__


Edit settings.xml
- Add API Key to UI.
Add line 14
<setting id="API Key" type="text" label="API Key" default="" />


Edit sickbeard.py
- Allow for SSL login (https) sites when retrieving images.
- Fix URL for retrieving images from SickRage.
Replace lines 61 to 73 with
  # Gets the show banner from Sickbeard  
  def GetShowBanner(self, show_id):
    if settings.__ssl_bool__ == "true":
        return 'https://'+settings.__ip__+':'+settings.__port__+'/cache/images/'+str(show_id)+'.banner.jpg'
    else:
        return 'http://'+settings.__ip__+':'+settings.__port__+'/cache/images/'+str(show_id)+'.banner.jpg'

  # Check if there is a cached thumbnail to use, if not use Sickbeard poster
  def GetShowPoster(self, show_id):
      if settings.__ssl_bool__ == "true":
        return 'https://'+settings.__ip__+':'+settings.__port__+'/cache/images/'+str(show_id)+'.poster.jpg'
      else:
        return 'http://'+settings.__ip__+':'+settings.__port__+'/cache/images/'+str(show_id)+'.poster.jpg'


Edit history.py
- Pass just one value of array to fix image name error.
Replace line 16
show_names[show_name] = str(tvdbid)
with
show_names[show_name] = str(tvdbid[0])
Reply


Messages In This Thread
[No subject] - by Popeye - 2012-03-06, 10:51
[No subject] - by ICDeadPpl - 2012-03-06, 11:57
[No subject] - by Popeye - 2012-03-06, 12:01
[No subject] - by Maniaczm - 2012-03-06, 17:37
[No subject] - by jaydash - 2012-03-07, 00:56
[No subject] - by redknight - 2012-03-07, 01:54
[No subject] - by Maniaczm - 2012-03-07, 02:07
[No subject] - by crimsonfury - 2012-03-07, 03:00
[No subject] - by Maniaczm - 2012-03-07, 03:06
[No subject] - by crimsonfury - 2012-03-07, 03:15
[No subject] - by Maniaczm - 2012-03-07, 04:50
[No subject] - by ursli - 2012-03-07, 13:31
[No subject] - by chemlab - 2012-03-07, 16:06
[No subject] - by acegutta22 - 2012-03-07, 16:25
[No subject] - by Maniaczm - 2012-03-07, 19:50
[No subject] - by Maniaczm - 2012-03-07, 19:53
[No subject] - by Maniaczm - 2012-03-07, 20:00
[No subject] - by ursli - 2012-03-07, 20:56
[No subject] - by Maniaczm - 2012-03-07, 21:03
[No subject] - by Popeye - 2012-03-07, 21:46
[No subject] - by Maniaczm - 2012-03-07, 22:02
[No subject] - by Popeye - 2012-03-07, 22:07
[No subject] - by Maniaczm - 2012-03-07, 22:12
[No subject] - by AdeXB - 2012-03-08, 02:02
[No subject] - by Maniaczm - 2012-03-08, 02:13
[No subject] - by AdeXB - 2012-03-08, 02:23
[No subject] - by Maniaczm - 2012-03-08, 02:31
[No subject] - by AdeXB - 2012-03-08, 03:13
[No subject] - by Maniaczm - 2012-03-08, 06:05
[No subject] - by gibxxi - 2012-03-08, 11:44
[No subject] - by myle - 2012-03-08, 12:24
[No subject] - by ursli - 2012-03-08, 13:01
[No subject] - by LoL - 2012-03-08, 14:16
[No subject] - by gibxxi - 2012-03-08, 18:00
[No subject] - by LoL - 2012-03-08, 18:35
[No subject] - by Maniaczm - 2012-03-08, 19:54
[No subject] - by Maniaczm - 2012-03-08, 19:59
[No subject] - by sglavach - 2012-03-08, 20:21
[No subject] - by salnajjar - 2012-03-08, 20:28
RE: - by Maniaczm - 2012-03-13, 03:18
[No subject] - by Maniaczm - 2012-03-08, 20:29
[No subject] - by Maniaczm - 2012-03-08, 20:31
[No subject] - by CpTHOOK - 2012-03-09, 03:46
[No subject] - by jdbrookes - 2012-03-10, 13:39
[No subject] - by Maniaczm - 2012-03-11, 00:12
RE: [RELEASE] Sickbeard XBMC - Control Sickbeard from XBMC - by Carey - 2015-06-08, 03:04
Logout Mark Read Team Forum Stats Members Help
[RELEASE] Sickbeard XBMC - Control Sickbeard from XBMC2