You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get a JSONDecodeError error when trying to translate yandex.
>>> print(ts.yandex('hello', 'en', 'zh'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/translators/apis.py", line 921, in yandex_api
data = r.json()
File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 898, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Also, in case of language detection, I get a 403 error.
>>> print(ts.yandex('hello'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/dist-packages/translators/apis.py", line 910, in yandex_api
from_language = self.detect_language(ss, query_text, self.sid, proxies) if from_language=='auto' else from_language
File "/usr/local/lib/python3.6/dist-packages/translators/apis.py", line 879, in detect_language
r.raise_for_status()
File "/usr/local/lib/python3.6/dist-packages/requests/models.py", line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://translate.yandex.net/api/v1/tr.json/detect?sid=....&srv=tr-text&text=hello&hint=zh%2Cen&options=1
The text was updated successfully, but these errors were encountered:
I get a JSONDecodeError error when trying to translate yandex.
Also, in case of language detection, I get a 403 error.
The text was updated successfully, but these errors were encountered: