Skip to content
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

Bing translator doesn't work #13

Closed
ZhymabekRoman opened this issue May 27, 2021 · 8 comments
Closed

Bing translator doesn't work #13

ZhymabekRoman opened this issue May 27, 2021 · 8 comments

Comments

@ZhymabekRoman
Copy link
Contributor

>>> from translatepy.translators.bing import BingTranslate
>>> dl = BingTranslate()
>>> dl.translate("hello", "ru")
Traceback (most recent call last):
  File "/home/ubuntu/translate/translatepy/translators/base.py", line 60, in translate
    translation = self._translate(text, dest_code, source_code)
  File "/home/ubuntu/translate/translatepy/translators/bing.py", line 84, in _translate
    return response[0]["translations"][0]["text"]
KeyError: 0

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/translate/translatepy/translators/base.py", line 75, in translate
    raise TranslationError from exc
translatepy.exceptions.TranslationError

Server response: {'statusCode': 400}

@Animenosekai
Copy link
Owner

I just checked and yea it might be because they changed their API

@ZhymabekRoman
Copy link
Contributor Author

Fixed in v2.0 alpha: ZhymabekRoman@80ce159
image

@ZhymabekRoman
Copy link
Contributor Author

ZhymabekRoman commented May 27, 2021

it might be because they changed their API

Yeah, they forbade accessing to the server without a key and token, I implemented parsing of the token, key, and other data as well as it was in old Yandex Translate implementation

@Animenosekai
Copy link
Owner

it might be because they changed their API

Yeah, they forbade accessing to the server without a key and token, I implemented parsing of the token, key, and other data as well as it was in old Yandex Translate implementation

Oh by parsing the website?

@ZhymabekRoman
Copy link
Contributor Author

Oh by parsing the website?

Yes, so far there are no other working methods

@NawtJ0sh
Copy link

NawtJ0sh commented Jul 2, 2021

Am getting this now with bing translate...

{u'errorMessage': u'', u'statusCode': 400}

@NawtJ0sh
Copy link

NawtJ0sh commented Jul 8, 2021

@Animenosekai Does anything from Bing work? Sorry I don't really use this translator.

@Animenosekai
Copy link
Owner

@NawtJ0sh Yes the actual version on main seems to work for now.

I'll publish translatepy v2 soon so it isn't available on PyPI for now but you can download the brand new version with git (look at the README for further information)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants