Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

KeyError location #22

Open
bendinwire opened this issue Jul 17, 2021 · 4 comments
Open

KeyError location #22

bendinwire opened this issue Jul 17, 2021 · 4 comments

Comments

@bendinwire
Copy link

bendinwire commented Jul 17, 2021

I think this is new, since I didn't have this last time I ran (and I changed nothing - also tried a fresh download just now). When running, passing in the -e and -p, I get this error:

Traceback (most recent call last): File "/Users/tornado/Desktop/tesla-oauth2-main/tesla.py", line 268, in <module> login(args) File "/Users/tornado/Desktop/tesla-oauth2-main/tesla.py", line 225, in login code = parse_qs(resp.headers["location"])["https://auth.tesla.com/void/callback?code"] File "/Users/tornado/.pyenv/versions/3.8.7/lib/python3.8/site-packages/requests/structures.py", line 54, in __getitem__ return self._store[key.lower()][1] KeyError: 'location'

@insaneoctane
Copy link

Same error. But before that, I get "Error with Permissions-Policy header: Unrecognized feature: 'interest-cohort'

@GeorgeIoak
Copy link

Just tried to run what worked back in May and I'm getting the same error also. Looking at response.headers I found the following:

font-src 'self' data: fonts.gstatic.com; 
frame-src 'self' www.google.com www.recaptcha.net; 
img-src 'self' data:; script-src www.recaptcha.net 'self' 'nonce-5618af177e75aa741baf'; 
style-src 'unsafe-inline' 'self'", 
'X-Content-Security-Policy': "connect-src 'self'; 
default-src 'none'; font-src 'self' data: fonts.gstatic.com; 
frame-src 'self' www.google.com www.recaptcha.net; 
img-src 'self' data:; 
script-src www.recaptcha.net 'self' 'nonce-5618af177e75aa741baf'; 
style-src 'unsafe-inline' 'self'", 
'X-WebKit-CSP': "connect-src 'self'; default-src 'none'; 
font-src 'self' data: fonts.gstatic.com; 
frame-src 'self' www.google.com www.recaptcha.net; 
img-src 'self' data:; script-src www.recaptcha.net 'self' 'nonce-5618af177e75aa741baf'; 
style-src 'unsafe-inline' 'self'", 

I'm not sure if this is new but it looks like Tesla is putting Captcha code check which we aren't responding properly to so this line fails:

code = parse_qs(resp.headers["location"])["https://auth.tesla.com/void/callback?code"]

@GeorgeIoak
Copy link

Refer to this discussion, timdorr/tesla-api#390 I downloaded the Tesla Token Android App to generate a new token and that worked for me.

@bendinwire
Copy link
Author

https:/tdorssers/TeslaPy

This has been working for me as a workaround to get the auth key now.

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

No branches or pull requests

3 participants