client log in fails with plugin request code, but works with requests module #19

nkuttler opened this Issue Feb 4, 2017 · 1 comment


None yet

2 participants

nkuttler commented Feb 4, 2017 edited

Version 5.3.8 kept throwing the exception below at me while trying to log in. At first I thought it was the API key as I had reinstalled the system recently, but no, that didn't fix this error either. After digging through the code and looking at the request code in particular I simply tried to use requests, see my code in 5f842f1. That "fixes" the login problem for me, but all other requests in the plugin fail with the same exception.

19:32:44 T:546526195488   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callb
ack/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAK
                                            Error Type: <class 'urllib2.URLError'>
                                            Error Contents: <urlopen error [Errno 0] Error
                                            Traceback (most recent call last):
                                              File "/home/kodi_user/.kodi/addons/plugin.vide", line 7, in <module>
                                              File "/home/kodi_user/.kodi/addons/", line 32, in run
                                      , context)
                                              File "/home/kodi_user/.kodi/addons/", line 23, in run
                                                results = provider.navigate(context)
                                              File "/home/kodi_user/.kodi/addons/", line 93, in navigate
                                                result = method(context, re_match)
                                              File "/home/kodi_user/.kodi/addons/", line 12, in wrapper
                                                return func(*args, **kwargs)
                                              File "/home/kodi_user/.kodi/addons/", line 426, in _on_sign
                                                yt_login.process(mode, self, context, re_match, context.get_settings().requires_dual_login())
                                              File "/home/kodi_user/.kodi/addons/", line 88, in process
                                                access_token_tv, expires_in_tv, refresh_token_tv = _do_login(_for_tv=True)
                                              File "/home/kodi_user/.kodi/addons/", line 11, in _do_login
                                                json_data = _client.generate_user_code_tv()
                                              File "/home/kodi_user/.kodi/addons/", line 172, in generate_user_code_tv
                                                return self.generate_user_code(client_id=client_id)
                                              File "/home/kodi_user/.kodi/addons/", line 199, in generate_user_code
                                                result =, data=post_data, headers=headers, verify=False)
                                              File "/home/kodi_user/.kodi/addons/", line 194, in post
                                                return _request('POST', url, data=data, json=json, **kwargs)
                                              File "/home/kodi_user/.kodi/addons/", line 165, in _request
                                                response =
                                              File "/usr/lib/python2.7/", line 429, in open
                                                response = self._open(req, data)
                                              File "/usr/lib/python2.7/", line 447, in _open
                                                '_open', req)
                                              File "/usr/lib/python2.7/", line 407, in _call_chain
                                                result = func(*args)
                                              File "/usr/lib/python2.7/", line 1241, in https_open
                                              File "/usr/lib/python2.7/", line 1198, in do_open
                                                raise URLError(err)
                                            URLError: <urlopen error [Errno 0] Error>
                                            -->End of Python script error report<--
19:32:44 T:546896752416  NOTICE: script.lazytvservice : 10.915558 :: 10.915558 :::  - get_eps_Ended

please see #14

@anxdpanic anxdpanic closed this Feb 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment