Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nkuttler opened this issue Feb 4, 2017 · 1 comment

Comments

@nkuttler
Copy link

nkuttler commented Feb 4, 2017

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
S!
                                            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
o.youtube/default.py", line 7, in <module>
                                                runner.run(__provider__)
                                              File "/home/kodi_user/.kodi/addons/plugin.video.youtube/resources/lib/kodion/runner.py", line 32, in run
                                                __RUNNER__.run(provider, context)
                                              File "/home/kodi_user/.kodi/addons/plugin.video.youtube/resources/lib/kodion/impl/xbmc/xbmc_runner.py", line 23, in run
                                                results = provider.navigate(context)
                                              File "/home/kodi_user/.kodi/addons/plugin.video.youtube/resources/lib/kodion/abstract_provider.py", line 93, in navigate
                                                result = method(context, re_match)
                                              File "/home/kodi_user/.kodi/addons/plugin.video.youtube/resources/lib/kodion/register_provider_path.py", line 12, in wrapper
                                                return func(*args, **kwargs)
                                              File "/home/kodi_user/.kodi/addons/plugin.video.youtube/resources/lib/youtube/provider.py", 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/plugin.video.youtube/resources/lib/youtube/helper/yt_login.py", line 88, in process
                                                access_token_tv, expires_in_tv, refresh_token_tv = _do_login(_for_tv=True)
                                              File "/home/kodi_user/.kodi/addons/plugin.video.youtube/resources/lib/youtube/helper/yt_login.py", line 11, in _do_login
                                                json_data = _client.generate_user_code_tv()
                                              File "/home/kodi_user/.kodi/addons/plugin.video.youtube/resources/lib/youtube/client/login_client.py", line 172, in generate_user_code_tv
                                                return self.generate_user_code(client_id=client_id)
                                              File "/home/kodi_user/.kodi/addons/plugin.video.youtube/resources/lib/youtube/client/login_client.py", line 199, in generate_user_code
                                                result = requests.post(url, data=post_data, headers=headers, verify=False)
                                              File "/home/kodi_user/.kodi/addons/plugin.video.youtube/resources/lib/kodion/simple_requests/api.py", line 194, in post
                                                return _request('POST', url, data=data, json=json, **kwargs)
                                              File "/home/kodi_user/.kodi/addons/plugin.video.youtube/resources/lib/kodion/simple_requests/api.py", line 165, in _request
                                                response = opener.open(request)
                                              File "/usr/lib/python2.7/urllib2.py", line 429, in open
                                                response = self._open(req, data)
                                              File "/usr/lib/python2.7/urllib2.py", line 447, in _open
                                                '_open', req)
                                              File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
                                                result = func(*args)
                                              File "/usr/lib/python2.7/urllib2.py", line 1241, in https_open
                                                context=self._context)
                                              File "/usr/lib/python2.7/urllib2.py", 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
@anxdpanic
Copy link
Collaborator

please see #14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants