kodamaChameleon / ghunt-maltego

Maltego Transform Partner to Ghunt
GNU General Public License v3.0
10 stars 2 forks source link

json.decoder.JSONDecodeError #5

Closed kodamaChameleon closed 1 year ago

kodamaChameleon commented 1 year ago

Not sure why certain emails receive the following error.

Traceback (most recent call last):
  File "/home/osint/.local/lib/python3.11/site-packages/maltego_trx/server.py", line 38, in run_transform
    return transform_method.run_transform(client_msg), 200  # Transform class
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/osint/.local/lib/python3.11/site-packages/maltego_trx/transform.py", line 12, in run_transform
    cls.create_entities(request, response)
  File "/home/osint/Transforms/ghunt-maltego/transforms/ghuntFromEmail.py", line 82, in create_entities
    trio.run(main) # running our async code in a non-async code
    ^^^^^^^^^^^^^^
  File "/home/osint/.local/lib/python3.11/site-packages/trio/_core/_run.py", line 1946, in run
    raise runner.main_task_outcome.error
  File "/home/osint/Transforms/ghunt-maltego/transforms/ghuntFromEmail.py", line 66, in main
    err, stats, reviews, photos = await gmaps.get_reviews(as_client, person.personId)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/osint/.local/lib/python3.11/site-packages/ghunt/helpers/gmaps.py", line 56, in get_reviews
    data = json.loads(req.text[5:])
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/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)
kodamaChameleon commented 1 year ago

Commit 5e0a2a6529cd9b29d34016caa5207c83a8e1aa79 includes details of root cause. Current work around would be to use a proxy to change one's IP address.

kodamaChameleon commented 1 year ago

Issue is with blocked IP