gkeepapi: raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError

Today was unable to use this API, it was working good yesterday:

Traceback (most recent call last):
  File "gg1.py", line 30, in <module>
    keep.resume('mymail@gmail.com', token1)
  File "C:\Users\NEG\AppData\Local\Programs\Python\Python38-32\lib\site-packages\gkeepapi\__init__.py", line 714, in resume
    self.load(auth, state, sync)
  File "C:\Users\NEG\AppData\Local\Programs\Python\Python38-32\lib\site-packages\gkeepapi\__init__.py", line 741, in load
    self.sync(True)
  File "C:\Users\NEG\AppData\Local\Programs\Python\Python38-32\lib\site-packages\gkeepapi\__init__.py", line 1016, in sync
    changes = self._keep_api.changes(
  File "C:\Users\NEG\AppData\Local\Programs\Python\Python38-32\lib\site-packages\gkeepapi\__init__.py", line 356, in changes
    return self.send(
  File "C:\Users\NEG\AppData\Local\Programs\Python\Python38-32\lib\site-packages\gkeepapi\__init__.py", line 221, in send
    response = self._send(**req_kwargs).json()
  File "C:\Users\NEG\AppData\Local\Programs\Python\Python38-32\lib\site-packages\requests\models.py", line 898, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Users\NEG\AppData\Local\Programs\Python\Python38-32\lib\json\__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "C:\Users\NEG\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\NEG\AppData\Local\Programs\Python\Python38-32\lib\json\decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "gg1.py", line 43, in <module>
    print(e.raw)
AttributeError: 'JSONDecodeError' object has no attribute 'raw'

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (3 by maintainers)

Commits related to this issue

Most upvoted comments

Looks like Google is explicitly blocking requests with gkeepapi in the User-Agent. Changing it to any other value works fine. Not sure how I want to proceed here - this could become a tedious cat & mouse game. In the meantime, if you want to fix this yourself you can update line 184 in __init__.py.