lushan88a / google_trans_new

A free and unlimited python API for google translate.
MIT License
393 stars 170 forks source link

this does not work at all, JSONDecodeError when parse the response #48

Closed braindevices closed 3 years ago

braindevices commented 3 years ago

here is the error

translator = google_translator()
translator.translate("test", lang_tgt="zh")
 File "/lib/python3.8/site-packages/google_trans_new/google_trans_new.py", line 188, in translate
    raise e
  File "/lib/python3.8/site-packages/google_trans_new/google_trans_new.py", line 152, in translate
    response = json.loads(response)
  File "/usr/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 340, in decode
    raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 2384 (char 2383)
braindevices commented 3 years ago

duplicates

Justin-Xiang commented 2 years ago

hey, I came across the same error, how to fix it?

gptshubham595 commented 2 years ago

how u fixed this?