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

change in URL for UK users? #35

Open
irekzielinski opened this issue May 29, 2018 · 16 comments
Open

change in URL for UK users? #35

irekzielinski opened this issue May 29, 2018 · 16 comments

Comments

@irekzielinski
Copy link

irekzielinski commented May 29, 2018

Hi guys. Started to get this error recently (used to work 99% of time, not always fails):

DEBUG:pycarwings2.pycarwings2:invoking carwings API: https://gdcportalgw.its-mo.com/gworchest_160803A/gdc/InitialApp.php
DEBUG:pycarwings2.pycarwings2:params: {
   "RegionCode": "NE",
   "custom_sessionid": "",
   "initial_app_strings": "redacted_out",
   "lg": "en-US"
}
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): gdcportalgw.its-mo.com
DEBUG:urllib3.connectionpool:https://gdcportalgw.its-mo.com:443 "POST /gworchest_160803A/gdc/InitialApp.php HTTP/1.1" 404 234
DEBUG:pycarwings2.pycarwings2:Response HTTP Status Code: 404
DEBUG:pycarwings2.pycarwings2:Response HTTP Response Body: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /gworchest_160803A/gdc/InitialApp.php was not found on this server.</p>
</body></html>

Traceback (most recent call last):
  File "get-leaf-battery.py", line 33, in <module>
    l = s.get_leaf()
  File "/usr/local/lib/python2.7/dist-packages/pycarwings2/pycarwings2.py", line 189, in get_leaf
    self.connect()
  File "/usr/local/lib/python2.7/dist-packages/pycarwings2/pycarwings2.py", line 151, in connect
    "lg": "en-US",
  File "/usr/local/lib/python2.7/dist-packages/pycarwings2/pycarwings2.py", line 134, in _request
    j = json.loads(response.content)
  File "/usr/lib/python2.7/json/__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Looks like the URL changed?
Anyone seeing this?

Cheers,
Irek

@gym22
Copy link

gym22 commented May 29, 2018 via email

@irekzielinski
Copy link
Author

oh snap!
hope new API works in Europe - code looks like US oriented....

@rduivenvoorde
Copy link
Contributor

rduivenvoorde commented May 30, 2018

@irekzielinski my scripts broke too... but the official app is still working with me. Not sure how to find out which api/server that it is using now...

I also tried BenWoodfords calls (from the comments), but get an

{"errorMessage":"Authentication Failure","errorCode":910}

using NE as country

@jdhorne what do you think?

@gym22
Copy link

gym22 commented May 30, 2018

The US and EU apps are now completely different.
https://play.google.com/store/apps/details?id=com.digitas.android.nissan.carwings
https://play.google.com/store/apps/details?id=com.aqsmartphone.android.nissan

I think the new API is for the US app only.

@gym22
Copy link

gym22 commented May 30, 2018

got the new url from the eu app: https://gdcportalgw.its-mo.com/api_v180117_NE/gdc

replace BASE_URL in pycarwings2.py and it works.

@BenWoodford
Copy link

@gym22 thanks for that info!

Indeed the new API is only in the US (and probably Japan?), the old API is the only one we have in the EU.

joeshaw added a commit to joeshaw/carwings that referenced this issue May 30, 2018
Extracted from the EU app by @gym22 in
jdhorne/pycarwings2#35 (comment)

Fixes #2.
@rduivenvoorde
Copy link
Contributor

rduivenvoorde commented May 30, 2018

@gym22 THANKS! Created a PR, url needs to end with a '/' :

BASE_URL = "https://gdcportalgw.its-mo.com/api_v180117_NE/gdc/"

Works like a charm \o/

BenWoodford pushed a commit to BenWoodford/pycarwings2 that referenced this issue May 31, 2018
@glynhudson
Copy link

Good spot. I wonder if this is to do with the new European GDPR? European user data is now hopefully being kept in Europe. Hopefully this will improve reliability.

@tarcus69
Copy link

Looks like it's changed again today: https://twitter.com/NissanEV_UK/status/1076200864044515328?s=15

I'm getting a 404 not found on the standard UK API now.

@Wobbley
Copy link

Wobbley commented Dec 23, 2018

I can verify the same, do we know what the new URL is?

@gym22
Copy link

gym22 commented Dec 23, 2018 via email

@BenWoodford
Copy link

Oh, I used this one:

BenWoodford@1170caf

@tarcus69
Copy link

@BenWoodford working fine for me with that new URL.

@rduivenvoorde
Copy link
Contributor

rduivenvoorde commented Dec 24, 2018

For me (NL here) the https://gdcportalgw.its-mo.com/api_v181217_NE/, but @BenWoodford's one: https://gdcportalgw.its-mo.com/gworchest_160803EC/gdc/ is.

Update: when adding "/gdc/" to the first url BOTH are working for me: https://gdcportalgw.its-mo.com/api_v181217_NE/gdc/

Thanks All, for this work!

@joeshaw
Copy link

joeshaw commented Jan 1, 2019

See also the discussion on BenWoodford@1170caf

@filcole
Copy link

filcole commented Jan 4, 2019

I've got a working version of this library and published it to PyPi.

It uses the same URL as mentioned above #35 (comment) and also by dartcarwings

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

9 participants