Login Exception (Linux version)
The following occurs (only) in Linux. It's been like that for quite a while (including the just tested 5.5 alpha). TIA, Enoch.
02:23:27.644 T:140568085387008 NOTICE: [plugin.video.youtube] Running: YouTube (5.4.5) on Krypton (Kodi-17.4) with Python 2.7.13 02:23:31.029 T:140568085387008 NOTICE: Previous line repeats 1 times. 02:23:31.029 T:140568085387008 ERROR: [plugin.video.youtube] YouTube: LoginException: Login Failed: Code 400
I'm not able to reproduce, working fine osmc/debian. Can you provide a debug log
This Kodi host is Kubuntu 17.04. With debug logging enabled:
09:45:03.320 T:140321984026368 DEBUG: CPythonInvoker(19, /home/enoch/.kodi/addons/plugin.video.youtube/resources/lib/default.py): entering source directory /home/enoch/.kodi/addons/plugin.video.youtube/resources/lib 09:45:03.320 T:140321984026368 DEBUG: CPythonInvoker(19, /home/enoch/.kodi/addons/plugin.video.youtube/resources/lib/default.py): instantiating addon using automatically obtained id of "plugin.video.youtube" dependent on version 2.19.0 of the xbmc.python api 09:45:03.592 T:140321984026368 DEBUG: [plugin.video.youtube] Using API key set: own 09:45:03.603 T:140321984026368 DEBUG: [plugin.video.youtube] Starting Kodion framework by bromix... 09:45:03.603 T:140321984026368 NOTICE: [plugin.video.youtube] Running: YouTube (5.4.5) on Krypton (Kodi-17.4) with Python 2.7.13 09:45:03.603 T:140321984026368 DEBUG: [plugin.video.youtube] Path: "/sign/in/ 09:45:03.603 T:140321984026368 DEBUG: [plugin.video.youtube] Params: "{}" 09:45:03.605 T:140321984026368 DEBUG: [plugin.video.youtube] Sign-in: Dual login required |True| 09:45:03.753 T:140325436098944 DEBUG: ------ Window Init (DialogBusy.xml) ------ 09:45:03.754 T:140325436098944 DEBUG: ------ Window Init (DialogConfirm.xml) ------ 09:45:04.902 T:140325436098944 DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x000d, modifier: 0x0 09:45:04.969 T:140325436098944 DEBUG: OnKey: return (0xf00d) pressed, action is Select 09:45:04.969 T:140325436098944 DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x0000, modifier: 0x0 09:45:05.235 T:140325436098944 DEBUG: ------ Window Deinit (DialogConfirm.xml) ------ 09:45:05.237 T:140321984026368 DEBUG: [plugin.video.youtube] Selecting YouTube config "All" 09:45:05.237 T:140321984026368 DEBUG: [plugin.video.youtube] User is not logged in 09:45:05.475 T:140321984026368 DEBUG: DialogProgress::Open called 09:45:05.475 T:140321984026368 DEBUG: ------ Window Init (DialogConfirm.xml) ------ 09:45:05.564 T:140321984026368 ERROR: [plugin.video.youtube] YouTube: LoginException: Login Failed: Code 400 09:45:05.570 T:140325436098944 DEBUG: ------ Window Init (DialogAddonSettings.xml) ------ 09:45:05.571 T:140325436098944 DEBUG: ------ Window Init (DialogNotification.xml) ------ 09:45:07.020 T:140325436098944 DEBUG: Keyboard: scancode: 0x25, sym: 0x0132, unicode: 0x0000, modifier: 0x40 09:45:07.020 T:140325436098944 DEBUG: OnKey: ctrl-leftctrl (0x1f0d0) pressed, action is
That didn't provide enough information so I just added a bunch of debug logging in this area so we can hopefully get to the bottom of it. If you are able, can you give the current master a try (and produce a debug log). If not I will likely update the zips tomorrow @ https://github.com/jdf76/plugin.video.youtube/releases/tag/5.5.0-alpha , ~alpha5 will include the additional logging.
Below is the debug log of the latest git version.
commit 02add25481738614c2a7d0875e563b282c0429af Merge: f217e18 f723a44 Author: anxdpanic [email protected] Date: Sat Oct 14 15:05:55 2017 -0400
Merge pull request #166 from anxdpanic/pr
code cosmetics and login client logging
-- 17:48:09.246 T:140300336715520 NOTICE: [plugin.video.youtube] Running: YouTube (5.5.0~alpha4) on Krypton (Kodi-17.4) with Python 2.7.13 17:48:09.247 T:140300336715520 DEBUG: [plugin.video.youtube] Path: "/sign/in/ 17:48:09.247 T:140300336715520 DEBUG: [plugin.video.youtube] Params: "{}" 17:48:09.248 T:140300336715520 DEBUG: [plugin.video.youtube] Sign-in: Dual login required |True| 17:48:09.308 T:140300845267328 DEBUG: ------ Window Init (DialogBusy.xml) ------ 17:48:09.310 T:140300845267328 DEBUG: ------ Window Init (DialogConfirm.xml) ------ 17:48:09.311 T:140300845267328 DEBUG: ------ Window Deinit (Pointer.xml) ------ 17:48:10.075 T:140300845267328 DEBUG: ------ Window Init (Pointer.xml) ------ 17:48:11.191 T:140300845267328 DEBUG: ProcessMouse: trying mouse action leftclick 17:48:11.192 T:140300845267328 DEBUG: ------ Window Deinit (Pointer.xml) ------ 17:48:11.458 T:140300845267328 DEBUG: ------ Window Deinit (DialogConfirm.xml) ------ 17:48:11.460 T:140300336715520 DEBUG: [plugin.video.youtube] Selecting YouTube config "All" 17:48:11.460 T:140300336715520 DEBUG: [plugin.video.youtube] User is not logged in 17:48:11.460 T:140300336715520 DEBUG: [plugin.video.youtube] Generating user code: Config: |YouTube-TV| Client id [:5]: |86155| 17:48:11.786 T:140300336715520 DEBUG: DialogProgress::Open called 17:48:11.786 T:140300336715520 DEBUG: ------ Window Init (DialogConfirm.xml) ------ 17:48:11.786 T:140300336715520 DEBUG: [plugin.video.youtube] Retrieving device token: Config: |YouTube-TV| Client id [:5]: |86155| Client secret [:5]: |SboVh| 17:48:11.881 T:140300336715520 ERROR: [plugin.video.youtube] Retrieving device token: Code: |400| JSON: |{u'error_description': u'Credentials in post body and basic Authorization header do not match', u'error': u'invalid_request'}| 17:48:11.907 T:140300336715520 ERROR: [plugin.video.youtube] YouTube: LoginException: invalid_request
Thanks for following up. That snippet is more informative but the error description makes no sense in this context.
Since I'm at a loss for the cause here, I re-visited all the login requests and updated them to match current documentation. It was still original code in this area that appears to have become outdated(but functional), not sure if this will resolve or produce a different result for you. I've updated the zip in Releases if you'd like to give it a try.
Here's the log after pulling your latest commit cb86821. Please don't give up :-)
11:13:26.261 T:140323778959104 DEBUG: CPythonInvoker(23, /home/enoch/.kodi/addons/plugin.video.youtube/resources/lib/default.py): entering source directory /home/enoch/.kodi/addons/plugin.video.youtube/resources/lib 11:13:26.261 T:140323778959104 DEBUG: CPythonInvoker(23, /home/enoch/.kodi/addons/plugin.video.youtube/resources/lib/default.py): instantiating addon using automatically obtained id of "plugin.video.youtube" dependent on version 2.20.0 of the xbmc.python api 11:13:26.517 T:140323778959104 DEBUG: [plugin.video.youtube] Using API key set: own 11:13:26.526 T:140323778959104 DEBUG: [plugin.video.youtube] Starting Kodion framework by bromix... 11:13:26.526 T:140323778959104 NOTICE: [plugin.video.youtube] Running: YouTube (5.5.0~alpha5) on Krypton (Kodi-17.4) with Python 2.7.13 11:13:26.526 T:140323778959104 DEBUG: [plugin.video.youtube] Path: "/sign/in/ 11:13:26.526 T:140323778959104 DEBUG: [plugin.video.youtube] Params: "{}" 11:13:26.527 T:140323778959104 DEBUG: [plugin.video.youtube] Sign-in: Dual login required |True| 11:13:26.700 T:140326076053888 DEBUG: ------ Window Init (DialogBusy.xml) ------ 11:13:26.701 T:140326076053888 DEBUG: ------ Window Init (DialogConfirm.xml) ------ 11:13:28.100 T:140326076053888 DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x000d, modifier: 0x0 11:13:28.199 T:140326076053888 DEBUG: OnKey: return (0xf00d) pressed, action is Select 11:13:28.200 T:140326076053888 DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x0000, modifier: 0x0 11:13:28.449 T:140326076053888 DEBUG: ------ Window Deinit (DialogConfirm.xml) ------ 11:13:28.451 T:140323778959104 DEBUG: [plugin.video.youtube] Selecting YouTube config "All" 11:13:28.451 T:140323778959104 DEBUG: [plugin.video.youtube] User is not logged in 11:13:28.451 T:140323778959104 DEBUG: [plugin.video.youtube] Requesting device and user code: Config: |YouTube-TV| Client id [:5]: |86155| 11:13:28.751 T:140323778959104 DEBUG: DialogProgress::Open called 11:13:28.751 T:140323778959104 DEBUG: ------ Window Init (DialogConfirm.xml) ------ 11:13:28.751 T:140323778959104 DEBUG: [plugin.video.youtube] Requesting access token: Config: |YouTube-TV| Client id [:5]: |86155| Client secret [:5]: |SboVh| 11:13:28.838 T:140323778959104 ERROR: [plugin.video.youtube] Requesting access token: Code: |400| JSON: |{u'error_description': u'Credentials in post body and basic Authorization header do not match', u'error': u'invalid_request'}| 11:13:28.869 T:140323778959104 ERROR: [plugin.video.youtube] YouTube: LoginException: invalid_request
BTW, disabling my api-key did not help. Thanks.
Yeah, it's failing on the common key set which is used as first login for both with or without personal keys. Can you try disabling My Subscriptions and My Subscriptions (Filtered) in Settings -> Folders and then logging in. This will disable the dual login requirement and it will skip the common keys. It might narrow it down.
11:42:57.384 T:140325439928064 DEBUG: [plugin.video.youtube] Using API key set: 1 11:42:57.392 T:140326076053888 DEBUG: ------ Window Init (DialogBusy.xml) ------ 11:42:57.394 T:140326076053888 DEBUG: ------ Window Deinit (Pointer.xml) ------ 11:42:57.404 T:140325439928064 DEBUG: [plugin.video.youtube] Starting Kodion framework by bromix... 11:42:57.405 T:140325439928064 NOTICE: [plugin.video.youtube] Running: YouTube (5.5.0~alpha5) on Krypton (Kodi-17.4) with Python 2.7.13 11:42:57.405 T:140325439928064 DEBUG: [plugin.video.youtube] Path: "/sign/in/ 11:42:57.405 T:140325439928064 DEBUG: [plugin.video.youtube] Params: "{}" 11:42:57.407 T:140325439928064 DEBUG: [plugin.video.youtube] Sign-in: Dual login required |False| 11:42:57.409 T:140325439928064 DEBUG: [plugin.video.youtube] Selecting YouTube config "All" 11:42:57.409 T:140325439928064 DEBUG: [plugin.video.youtube] User is not logged in 11:42:57.409 T:140325439928064 DEBUG: [plugin.video.youtube] Requesting device and user code: Config: |YouTube-Kodi| Client id [:5]: |29489| 11:42:57.636 T:140325439928064 DEBUG: DialogProgress::Open called 11:42:57.636 T:140325439928064 DEBUG: ------ Window Init (DialogConfirm.xml) ------ 11:42:57.637 T:140325439928064 DEBUG: [plugin.video.youtube] Requesting access token: Config: |YouTube-Kodi| Client id [:5]: |29489| Client secret [:5]: |KTkBK| 11:42:57.737 T:140325439928064 ERROR: [plugin.video.youtube] Requesting access token: Code: |400| JSON: |{u'error_description': u'Credentials in post body and basic Authorization header do not match', u'error': u'invalid_request'}| 11:42:57.754 T:140325439928064 ERROR: [plugin.video.youtube] YouTube: LoginException: invalid_request
I used maintenance to delete all settings, etc. Folders subscriptions is off. I hope Kodi framework developers give a console to work with pdb.
There is a module for it I believe, Im used to tailing the log w/ powershell.
It's an undocumented response and no basic Authorization header is being set or expected per documentation and it's a first time for that api response. I can't even reproduce the response with a bogus basic authorization.
Are you using a proxy or anything that might modify request headers or post data?
I've added an undocumented client-id header and an Authorization header with an empty bearer, which causes no issues logging in here. You'll have to uninstall the add-on before being able to install the test zip. https://github.com/anxdpanic/_repository/releases/download/Testing/plugin.video.youtube-undoc_headers.5.5.0.alpha5.zip
Using commit bc09a5a. Let me know if I can be of further help. Thanks.
10:13:49.597 T:139649368446720 DEBUG: [plugin.video.youtube] Using API key set: 1 10:13:49.605 T:139649368446720 DEBUG: [plugin.video.youtube] Starting Kodion framework by bromix... 10:13:49.605 T:139649368446720 NOTICE: [plugin.video.youtube] Running: YouTube (5.5.0~alpha5) on Krypton (Kodi-17.4) with Python 2.7.13 10:13:49.605 T:139649368446720 DEBUG: [plugin.video.youtube] Path: "/sign/in/ 10:13:49.605 T:139649368446720 DEBUG: [plugin.video.youtube] Params: "{}" 10:13:49.606 T:139649368446720 DEBUG: [plugin.video.youtube] Sign-in: Dual login required |True| 10:13:49.801 T:139653100198272 DEBUG: ------ Window Init (DialogBusy.xml) ------ 10:13:49.803 T:139653100198272 DEBUG: ------ Window Init (DialogConfirm.xml) ------ 10:13:49.803 T:139653100198272 INFO: Loading skin file: DialogConfirm.xml, load type: KEEP_IN_MEMORY 10:13:50.934 T:139653100198272 DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x000d, modifier: 0x0 10:13:50.984 T:139653100198272 DEBUG: OnKey: return (0xf00d) pressed, action is Select 10:13:50.984 T:139653100198272 DEBUG: Keyboard: scancode: 0x24, sym: 0x000d, unicode: 0x0000, modifier: 0x0 10:13:51.234 T:139653100198272 DEBUG: ------ Window Deinit (DialogConfirm.xml) ------ 10:13:51.236 T:139649368446720 DEBUG: [plugin.video.youtube] Selecting YouTube config "All" 10:13:51.236 T:139649368446720 DEBUG: [plugin.video.youtube] User is not logged in 10:13:51.236 T:139649368446720 DEBUG: [plugin.video.youtube] Requesting device and user code: Config: |YouTube-TV| Client id [:5]: |86155| 10:13:51.546 T:139649368446720 DEBUG: DialogProgress::Open called 10:13:51.546 T:139649368446720 DEBUG: ------ Window Init (DialogConfirm.xml) ------ 10:13:51.546 T:139649368446720 DEBUG: [plugin.video.youtube] Requesting access token: Config: |YouTube-TV| Client id [:5]: |86155| Client secret [:5]: |SboVh| 10:13:51.637 T:139649368446720 ERROR: [plugin.video.youtube] Requesting access token: Code: |400| JSON: |{u'error_description': u'Credentials in post body and basic Authorization header do not match', u'error': u'invalid_request'}| 10:13:51.659 T:139649368446720 ERROR: [plugin.video.youtube] YouTube: LoginException: invalid_request
Can you try with the zip in the above comment, it has changes not added to master, last thing I can think of add-on side.
Using the a/m zip:
11:58:42.838 T:140644710332160 DEBUG: CPythonInvoker(20, /home/enoch/.kodi/addons/plugin.video.youtube/resources/lib/default.py): entering source directory /home/enoch/.kodi/addons/plugin.video.youtube/resources/lib 11:58:42.838 T:140644710332160 DEBUG: CPythonInvoker(20, /home/enoch/.kodi/addons/plugin.video.youtube/resources/lib/default.py): instantiating addon using automatically obtained id of "plugin.video.youtube" dependent on version 2.20.0 of the xbmc.python api 11:58:43.085 T:140644710332160 DEBUG: [plugin.video.youtube] Using API key set: 1 11:58:43.094 T:140644710332160 DEBUG: [plugin.video.youtube] Starting Kodion framework by bromix... 11:58:43.094 T:140644710332160 NOTICE: [plugin.video.youtube] Running: YouTube (5.5.0~alpha5) on Krypton (Kodi-17.4) with Python 2.7.13 11:58:43.094 T:140644710332160 DEBUG: [plugin.video.youtube] Path: "/sign/in/ 11:58:43.094 T:140644710332160 DEBUG: [plugin.video.youtube] Params: "{}" 11:58:43.095 T:140644710332160 DEBUG: [plugin.video.youtube] Sign-in: Dual login required |True| 11:58:43.282 T:140647453624704 DEBUG: ------ Window Init (DialogBusy.xml) ------ 11:58:43.283 T:140647453624704 DEBUG: ------ Window Init (DialogConfirm.xml) ------ 11:58:43.285 T:140647453624704 DEBUG: ------ Window Deinit (Pointer.xml) ------ 11:58:44.183 T:140647453624704 DEBUG: ------ Window Init (Pointer.xml) ------ 11:58:45.582 T:140647453624704 DEBUG: ProcessMouse: trying mouse action leftclick 11:58:45.583 T:140647453624704 DEBUG: ------ Window Deinit (Pointer.xml) ------ 11:58:45.832 T:140647453624704 DEBUG: ------ Window Deinit (DialogConfirm.xml) ------ 11:58:45.834 T:140644710332160 DEBUG: [plugin.video.youtube] Selecting YouTube config "All" 11:58:45.835 T:140644710332160 DEBUG: [plugin.video.youtube] User is not logged in 11:58:45.835 T:140644710332160 DEBUG: [plugin.video.youtube] Requesting device and user code: Config: |YouTube-TV| Client id [:5]: |86155| 11:58:46.134 T:140644710332160 DEBUG: DialogProgress::Open called 11:58:46.134 T:140644710332160 DEBUG: ------ Window Init (DialogConfirm.xml) ------ 11:58:46.134 T:140644710332160 DEBUG: [plugin.video.youtube] Requesting access token: Config: |YouTube-TV| Client id [:5]: |86155| Client secret [:5]: |SboVh| 11:58:46.262 T:140644710332160 ERROR: [plugin.video.youtube] Requesting access token: Code: |400| JSON: |{u'error_description': u'Credentials in post body and basic Authorization header do not match', u'error': u'invalid_request'}| 11:58:46.276 T:140644710332160 ERROR: [plugin.video.youtube] YouTube: LoginException: invalid_request
I'm also and still having the same issue with 6.2.2. Any progress on this? Can I help you any further?
Can either of you post a new debug log if the issue is persisting. I haven't been able to reproduce and no reports outside of this issue so it's been hard to track down issue.
At first, also with 6.2.3, the issue remained. But now, after deleting .kodi/userdata/addon_data/plugin.video.youtube/ and deleting my personal API keys at Google and freshly setting up everything, it now finally works!!!
See my previous contents of .kodi/userdata/addon_data/plugin.video.youtube/ attached as ZIP. Note that I deleted the personal API/client keys that are used in it, so in order to reproduce the problem, you have to replace them by your keys.
There was such a mistake. I deleted the ~/.netrc file. And it worked. :)
There was a line in the file .netrc
default login anonymous password xxxx@localhost
debian 10, kodi 2:17.6, plugin version 6.7.0
23:25:02.742 T:140175770375936 DEBUG: [plugin.video.youtube] Requesting access token: Config: |YouTube-TV| Client id [:5]: |
86155| Client secret [:5]: |SboVh|
23:25:03.070 T:140175770375936 DEBUG: [plugin.video.youtube] Requesting access token: |{"error_description": "Precondition R
equired", "error": "authorization_pending"}|
23:25:07.077 T:140177914065664 DEBUG: Keyboard: scancode: 0x17, sym: 0x0009, unicode: 0x0000, modifier: 0x0
23:25:07.378 T:140177914065664 DEBUG: ------ Window Init (Pointer.xml) ------
23:25:08.070 T:140175770375936 DEBUG: [plugin.video.youtube] Requesting access token: Config: |YouTube-TV| Client id [:5]: |
86155| Client secret [:5]: |SboVh|
23:25:08.734 T:140175770375936 DEBUG: [plugin.video.youtube] Requesting access token: |{"access_token": "<redacted>", "scope
": "https://www.googleapis.com/auth/youtube", "expires_in": 3599, "refresh_token": "<redacted>", "token_type": "Bearer"}|
23:25:08.746 T:140175770375936 DEBUG: [plugin.video.youtube] YouTube-TV Login: Access Token |True| Refresh Token |True| Expi
res |1587849907.73|
23:25:08.746 T:140175770375936 DEBUG: [plugin.video.youtube] Requesting device and user code: Config: |YouTube-Kodi| Client
id [:5]: |.apps|
23:25:08.909 T:140175770375936 ERROR: [plugin.video.youtube] Requesting device and user code failed: Code: |401| JSON: |{u'error_description': u'The OAuth client was not found.', u'error': u'invalid_client'}|
23:25:08.930 T:140175770375936 ERROR: [plugin.video.youtube] LoginException: [401] invalid_client: The OAuth client was not found.
23:25:08.930 T:140175770375936 WARNING: Attempt to use invalid handle -1
23:25:08.930 T:140175770375936 DEBUG: [plugin.video.youtube] Shutdown of Kodion after |24.1823| seconds
23:25:08.930 T:140175770375936 INFO: CPythonInvoker(4, /home/axet/.kodi/addons/plugin.video.youtube/resources/lib/default.py): script successfully run
@axet
Your client id is incorrect, it appears to be .apps.googleusercontent.com
You need the part before .apps.googleusercontent.com