KartikTalwar/Duolingo

Translations are Broken

JacobWeinbren opened this issue · 1 comments

Running the following

import duolingo
lingo  = duolingo.Duolingo(username='xxx', jwt='xxx')
words = [word['word_string'] for word in lingo.get_vocabulary(language_abbr='he')['vocab_overview']]
lingo.get_translations([words[0]])

Returns the following

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jacobweinbren/Documents/GitHub/Memrise-Duolingo/new.py", line 4, in <module>
    lingo.get_translations([words[0]])
  File "/Users/jacobweinbren/Documents/GitHub/Memrise-Duolingo/venv/lib/python3.11/site-packages/duolingo.py", line 484, in get_translations
    results = {**results, **self._get_raw_translations(segment, source, target)}
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobweinbren/Documents/GitHub/Memrise-Duolingo/venv/lib/python3.11/site-packages/duolingo.py", line 517, in _get_raw_translations
    request = self.session.get(url)
              ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobweinbren/Documents/GitHub/Memrise-Duolingo/venv/lib/python3.11/site-packages/requests/sessions.py", line 600, in get
    return self.request("GET", url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobweinbren/Documents/GitHub/Memrise-Duolingo/venv/lib/python3.11/site-packages/requests/sessions.py", line 587, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobweinbren/Documents/GitHub/Memrise-Duolingo/venv/lib/python3.11/site-packages/requests/sessions.py", line 701, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobweinbren/Documents/GitHub/Memrise-Duolingo/venv/lib/python3.11/site-packages/requests/adapters.py", line 565, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='d2.duolingo.com', port=443): Max retries exceeded with url: /api/1/dictionary/hints/en/he?tokens=%5B%22%5Cu05d8%5Cu05dc%22%5D (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x107f49210>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))

Do you know what might be causing this?

Apologies, this has already been raised.