-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
google trans new not working, causing jsonDecodeError #46
Comments
I am facing the same issue. The code snippet on the page doesn't work either. Locally the changes made to the line 155 in the file google_trans_new/google_trans_new.py works, but I am using the package as a dependency on Heroku, the error still persists there |
not working for me either |
does not work at all |
@Namyalg, can you specify your fix in google_trans_new.py? |
Hi, @erikjamesmason , I followed this issue #36, the third comment seemed to solve my problem locally |
@Namyalg awesome, thank you very much! |
google translator not working Traceback (most recent call last): Hope to get an alternative solution soon that works! Thankyou in advance :) |
Hey guys, having the same problem. As a workaround, do the following: EDIT: Whoops, that was already recommended in the other issue, sorry. |
I also encounted the json error. it is yet to still be fixed. I was able to use https://github.com/nidhaloff/deep-translator to solve my problem. |
Anaconda do it as you sad ,but not work, can you help? |
Sure, if you describe your issue further, i can see if i can help |
Hi, when I use your method to delete ] , anaconda doesn't work. It fails to delete ]. |
Thank you. It's working now |
it was working around one month ago. but suddenly it is showing json loading error
JSONDecodeError Traceback (most recent call last)
in
1 from google_trans_new import google_translator
2 translator = google_translator()
----> 3 translate_text = translator.translate('สวัสดีจีน',lang_tgt='en')
4 print(translate_text)
~\anaconda3\lib\site-packages\google_trans_new\google_trans_new.py in translate(self, text, lang_tgt, lang_src, pronounce)
186 return [sentences, pronounce_src, pronounce_tgt]
187 except Exception as e:
--> 188 raise e
189 r.raise_for_status()
190 except requests.exceptions.ConnectTimeout as e:
~\anaconda3\lib\site-packages\google_trans_new\google_trans_new.py in translate(self, text, lang_tgt, lang_src, pronounce)
150 try:
151 response = (decoded_line + ']')
--> 152 response = json.loads(response)
153 response = list(response)
154 response = json.loads(response[0][2])
~\anaconda3\lib\json_init_.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
346 parse_int is None and parse_float is None and
347 parse_constant is None and object_pairs_hook is None and not kw):
--> 348 return _default_decoder.decode(s)
349 if cls is None:
350 cls = JSONDecoder
~\anaconda3\lib\json\decoder.py in decode(self, s, _w)
338 end = _w(s, end).end()
339 if end != len(s):
--> 340 raise JSONDecodeError("Extra data", s, end)
341 return obj
342
JSONDecodeError: Extra data: line 1 column 343 (char 342)
The text was updated successfully, but these errors were encountered: