The Trailers - Issue
#1
Martijn or Sphere - not sure if either of you actively maintaining this addon still?

I've recently noticed that the "Add to CouchPotato" is no longer working and I'm not sure if it's something related to the upgrade to 13.1 or a new version of CP. I can play all trailers fine and clicking on "Add to CP" works and shows my quality profile, but when I click on it, it throws an error.

Here's the relevant part of the log, please let me know if you need the full debug log. Thanks.

Code:
20:00:55 T:140732112480192   DEBUG: ------ Window Deinit (DialogContextMenu.xml) ------
20:00:55 T:140732112480192   DEBUG: RunScriptWithParams - calling plugin The Trailers('plugin://plugin.video.the.trailers/add_to_couchpotato/The+Amazing+Spider-Man+2','-1','')
20:00:55 T:140730299311872  NOTICE: Thread LanguageInvoker start, auto delete: false
20:00:55 T:140730299311872    INFO: initializing python engine.
20:00:55 T:140730299311872   DEBUG: CPythonInvoker(10, /home/josh/.xbmc/addons/plugin.video.the.trailers/addon.py): start processing
20:00:55 T:140730299311872  NOTICE: -->Python Interpreter Initialized<--
20:00:55 T:140730299311872   DEBUG: CPythonInvoker(10, /home/josh/.xbmc/addons/plugin.video.the.trailers/addon.py): the source file to load is /home/josh/.xbmc/addons/plugin.video.the.trailers/addon.py
20:00:55 T:140730299311872   DEBUG: CPythonInvoker(10, /home/josh/.xbmc/addons/plugin.video.the.trailers/addon.py): setting the Python path to /home/josh/.xbmc/addons/plugin.video.the.trailers:/home/josh/.xbmc/addons/script.module.xbmcswift/lib:/home/josh/.xbmc/addons/script.module.pyamf/lib:/home/josh/.xbmc/addons/script.module.t0mm0.common/lib:/home/josh/.xbmc/addons/script.module.demjson/lib:/home/josh/.xbmc/addons/script.module.simplejson/lib:/home/josh/.xbmc/addons/script.module.beautifulsoup/lib:/usr/share/xbmc/addons/script.module.pil/lib:/home/josh/.xbmc/addons/script.common.plugin.cache/lib:/home/josh/.xbmc/addons/script.module.unidecode/lib:/home/josh/.xbmc/addons/script.module.simple.downloader/lib:/home/josh/.xbmc/addons/script.module.coveapi/lib:/home/josh/.xbmc/addons/script.module.free.cable.database/lib:/home/josh/.xbmc/addons/script.grab.fanart/default.py:/home/josh/.xbmc/addons/script.module.requests/lib:/home/josh/.xbmc/addons/script.module.buggalo/lib:/usr/share/xbmc/addons/xbmc.debug/:/home/josh/.xbmc/addons/script.module.parsedom/lib:/home/josh/.xbmc/addons/script.module.xbmcswift2/lib:/home/josh/.xbmc/addons/script.module.requests2/lib:/home/josh/.xbmc/addons/script.module.feedparser/lib:/usr/lib/python2.7:/usr/lib/python2.7/plat-x86_64-linux-gnu:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload:/usr/local/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages:/usr/lib/python2.7/dist-packages/PILcompat:/usr/lib/python2.7/dist-packages/gtk-2.0:/usr/lib/python2.7/dist-packages/ubuntu-sso-client:/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode
20:00:55 T:140730299311872   DEBUG: CPythonInvoker(10, /home/josh/.xbmc/addons/plugin.video.the.trailers/addon.py): entering source directory /home/josh/.xbmc/addons/plugin.video.the.trailers
20:00:55 T:140730299311872   DEBUG: CPythonInvoker(10, /home/josh/.xbmc/addons/plugin.video.the.trailers/addon.py): instantiating addon using automatically obtained id of "plugin.video.the.trailers" dependent on version 2.1.0 of the xbmc.python api
20:00:55 T:140730299311872 WARNING: Attempt to use invalid handle -1
20:00:55 T:140730299311872  NOTICE: The Trailers addon: add_to_couchpotato started with movie_title=The Amazing Spider-Man 2
20:00:55 T:140732112480192   DEBUG: ------ Window Init (DialogSelect.xml) ------
20:00:55 T:140732112480192    INFO: Loading skin file: DialogSelect.xml, load type: KEEP_IN_MEMORY
20:00:56 T:140732112480192   DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x000d, modifier: 0x0
20:00:56 T:140732112480192   DEBUG: OnKey: return (0xf00d) pressed, action is Select
20:00:56 T:140732112480192   DEBUG: ------ Window Deinit (DialogSelect.xml) ------
20:00:56 T:140730299311872   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.KeyError'>
                                            Error Contents: 'id'
                                            Traceback (most recent call last):
                                              File "/home/josh/.xbmc/addons/plugin.video.the.trailers/addon.py", line 489, in <module>
                                                plugin.run()
                                              File "/home/josh/.xbmc/addons/script.module.xbmcswift/lib/xbmcswift/plugin.py", line 330, in run
                                                self.dispatch(self.path)
                                              File "/home/josh/.xbmc/addons/script.module.xbmcswift/lib/xbmcswift/plugin.py", line 129, in dispatch
                                                return view_func(**items)
                                              File "/home/josh/.xbmc/addons/plugin.video.the.trailers/addon.py", line 336, in add_to_couchpotato
                                                couchpotato.Main()
                                              File "/home/josh/.xbmc/addons/plugin.video.the.trailers/resources/lib/couchpotatov2.py", line 48, in __init__
                                                self._search_and_add_to_couchpotato()
                                              File "/home/josh/.xbmc/addons/plugin.video.the.trailers/resources/lib/couchpotatov2.py", line 124, in _search_and_add_to_couchpotato
                                                if self._add_to_couchpotato():
                                              File "/home/josh/.xbmc/addons/plugin.video.the.trailers/resources/lib/couchpotatov2.py", line 135, in _add_to_couchpotato
                                                profile_id = qualities[self.qualitychoice]["id"]
                                            KeyError: 'id'
                                            -->End of Python script error report<--
Reply
#2
I was able to get it working again, although it probably isn't the proper solution. I had to remove the "profile" info from being passed. I think something has changed with the CP API.

In the couchpotatov2.py I made the following changes -

line 135 - commented it out.
Code:
#profile_id = qualities[self.qualitychoice]["id"]

line 140 - commented it out.
Code:
#values = { 'profile_id': profile_id,

line 141 - changed it to this
Code:
values = { 'identifier': identifier,
Reply

Logout Mark Read Team Forum Stats Members Help
The Trailers - Issue0