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

regular expression in _parse_sid is not valid #1

Open
KruASe76 opened this issue Jul 6, 2024 · 0 comments
Open

regular expression in _parse_sid is not valid #1

KruASe76 opened this issue Jul 6, 2024 · 0 comments

Comments

@KruASe76
Copy link

KruASe76 commented Jul 6, 2024

вне зависимости от заданного при инициализации типа api возникает ошибка:

Traceback (most recent call last):
  File "/home/kruase/.local/share/virtualenvs/python-playground-7wYzP8hx/lib/python3.12/site-packages/yandexfreetranslate/__init__.py", line 116, in _parse_sid
    return re.search(r'''SID[\s]?[:][\s]?['"]([^'"]+)['"]''', page).group(1)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'group'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kruase/projects/python-playground/yandex_translate_api.py", line 5, in <module>
    print(translator.translate("en", "ru", "Red Square 3, Tverskoy District, Moscow, Russia, 109012"))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kruase/.local/share/virtualenvs/python-playground-7wYzP8hx/lib/python3.12/site-packages/yandexfreetranslate/__init__.py", line 157, in translate
    if self.key == "": self.key = self._get_key()
                                  ^^^^^^^^^^^^^^^
  File "/home/kruase/.local/share/virtualenvs/python-playground-7wYzP8hx/lib/python3.12/site-packages/yandexfreetranslate/__init__.py", line 134, in _get_key
    sid = self._parse_sid()
          ^^^^^^^^^^^^^^^^^
  File "/home/kruase/.local/share/virtualenvs/python-playground-7wYzP8hx/lib/python3.12/site-packages/yandexfreetranslate/__init__.py", line 118, in _parse_sid
    raise YandexFreeTranslateError("blocked or not found")
yandexfreetranslate.YandexFreeTranslateError: blocked or not found
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

1 participant