Open moseisleydk opened 3 years ago
Thanks for fixing #16
ok, MyT app stalls at 65% now .... will test later
Ok, MyT works now:
I suggest you check your VIN from the config. It seems that when you have invalid VIN there all the data is returned as HTTP 204 instead of expected HTTP 403. Maybe you have copy-paste error there?
Hi,
You were correct, my bad :-(
Current status:
╰─# python ./tojota.py 2021-01-31 11:10:00,142:main:INFO: Fetching trips... 2021-01-31 11:10:01,543:main:INFO: Failed to use cached token, doing fresh login... 2021-01-31 11:10:01,544:main:INFO: Logging in... 2021-01-31 11:10:02,536:main:INFO: Fetching trips... Traceback (most recent call last): File "./tojota.py", line 371, in main trips, fresh = myt.get_trips() File "./tojota.py", line 161, in get_trips self._write_file(trips_file, r.text) File "./tojota.py", line 109, in _write_file f.write(contents) UnicodeEncodeError: 'ascii' codec can't encode character '\xe6' in position 170: ordinal not in range(128)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./tojota.py", line 457, in
Argh - think I have solved that earlier with something in the top line ...
no, adding:
Did not solve it
Which python version are you using?
(tojota) ╭─root@sparrow ~/tojota ‹master› ╰─# python --version 1 ↵ Python 3.6.9 (tojota) ╭─root@sparrow ~/tojota ‹master› ╰─#
Hmm. Python 3.x should not have that problem at all. Adding # -- coding: utf-8 -- was the fix for python 2.
Anything I can do to assist? I am a total python noob
Can you provide that problematic trips file as an attachment here? Get trips.json with curl like
curl -H 'X-TME-TOKEN: [your_secret_token]' -o trips.json https://cpb2cs.toyota-europe.com/api/user/[your_uuid]/cms/trips/v2/history/vin/[your_vin]/1
where [your_secret_token] and [your_uuid] can be found from cache/user_data.json after you have run tojota.py recently and [vin] is your car VIN.
If you don't feel comfortable posting your driving data here send it via email to me.
No problem, heres there file. Im from Denmark, så some æøå
I'm in Finland so we have some öäöä here too and those are not a problem. File content seems to be fine for me, need to do some more python testing with it.
Sure, do leave a message for me if my tests are needed. Appreciate the effort!!
BR,
Normann
╰─# python ./tojota.py 2021-01-31 10:46:51,682:main:INFO: Fetching trips... 2021-01-31 10:46:52,038:main:INFO: Failed to use cached token, doing fresh login... 2021-01-31 10:46:52,038:main:INFO: Logging in... 2021-01-31 10:46:52,812:main:INFO: Fetching trips... 2021-01-31 10:46:53,384:main:INFO: Get parking info... Didn't get parking information! 2021-01-31 10:46:53,719:main:INFO: Get odometer info... Traceback (most recent call last): File "./tojota.py", line 457, in
sys.exit(main())
File "./tojota.py", line 399, in main
odometer, odometer_unit, fuel_percent, fresh = myt.get_odometer_fuel()
File "./tojota.py", line 232, in get_odometer_fuel
raise ValueError('Failed to get data {} {} {}'.format(r.text, r.status_code, r.headers))
ValueError: Failed to get data 204 {'Cache-Control': 'no-cache, no-store, max-age=0, must-revalidate', 'Pragma': 'no-cache', 'Expires': '0', 'Server': 'Jetty(9.3.25.v20180904)', 'Request-Context': 'appId=**', 'ID': '****, 'X-Content-Type-Options': 'nosniff', 'X-XSS-Protection': '1; mode=block', 'X-Frame-Options': 'DENY', 'X-Powered-By': 'ASP.NET', 'Set-Cookie': 'ARRAffinity=*;Path=/;HttpOnly;Secure;Domain=myt-agg.toyota-europe.com, ARRAffinitySameSite=**;Path=/;HttpOnly;SameSite=None;Secure;Domain=myt-agg.toyota-europe.com, visid_incap_2173333=**; expires=Sun, 30 Jan 2022 11:49:57 GMT; HttpOnly; path=/; Domain=.toyota-europe.com, incapses*****==; path=/; Domain=.toyota-europe.com, utmvmoZBuyvPZZ=EKlDNdcLjba; path=/; Max-Age=900, utmvaoZBuyvPZZ=ARX\x01PDSQ; path=/; Max-Age=900, ___utmvboZBuyvPZZ=CZZ\r\n XKkOUalY: XtT; path=/; Max-Age=900', 'Date': 'Sun, 31 Jan 2021 09:46:53 GMT', 'X-CDN': 'Incapsula', 'X-Iinfo': '2-**** PNNy RT(1612086413591 21) q(0 0 0 0) r(2 2) U11'}
(tojota) ╭─root@sparrow ~/tojota ‹master*›
╰─#