harperreed / life360-python

A simple python life360 client
MIT License
35 stars 18 forks source link

Issue with Python JSON Handling? #6

Open Mariner10 opened 11 months ago

Mariner10 commented 11 months ago
File "life360.py", line 41, in authenticate
    r = self.make_request(url=url, params=params, method='POST', authheader="Basic " + self.authorization_token)
  File "life360.py", line 29, in make_request
    return r.json()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/requests/models.py", line 975, in json
    raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Not sure what this issue is cropping up from. I just got around to fixing my program with the updated AUTH values however now Python is complaining about JSON decoding?

justinross5 commented 9 months ago

FYI I am having the same issue, i put a print within the get auth calls and i am getting a 403 error, so i think it is something with the authorization still. I have tried to pull in the new code and no luck.

Mariner10 commented 9 months ago

FYI I am having the same issue, i put a print within the get auth calls and i am getting a 403 error, so i think it is something with the authorization still. I have tried to pull in the new code and no luck.

I fixed my issue last night actually, the issue has to do with Life360s way of handling too many requests to the api. When you make to many requests my best guess is that Life360 revokes your next call and sends back a blank json, which leads to the errors we were facing. So my solution for you is reduce the number of time you call the api.

justinross5 commented 9 months ago

interesting, i only called the api one time in the last two months, ive had it disabled because i havent gotten it to work since. Are you still using the Y2F token?

Mariner10 commented 9 months ago

interesting, i only called the api one time in the last two months, ive had it disabled because i havent gotten it to work since. Are you still using the Y2F token?

I believe so, go onto my profile and look at Triangular-inator and view my logger360.py file. It works for me