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

[Bug]: Getting 302 Response #24

Open
2 tasks done
powellnorma opened this issue Apr 14, 2023 · 5 comments
Open
2 tasks done

[Bug]: Getting 302 Response #24

powellnorma opened this issue Apr 14, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@powellnorma
Copy link

What happened?

I think maybe the text is too long?

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="https://www.google.com/sorry/index?continue=https://translate.google.com/translate_a/single%3Fclient%3Dgtx%26sl%3Dde%2

OS / Environment

gpytranslate 1.5.1

Traceback

No response

Searched before submitting

  • I searched for duplicates, and didn't found anything.
  • I searched this bug on a search engine, and didn't found anything.
@powellnorma powellnorma added the bug Something isn't working label Apr 14, 2023
@DavideGalilei
Copy link
Owner

If I'm not mistaken, the maximum text length is limited to 2500 characters. You might consider dividing the text into smaller chunks and translating them separately. I plan on implementing this in the library soon.

Could you please provide more details about the text length you tried translating?

@powellnorma
Copy link
Author

Seems likely, the text had >7k characters. Maybe you can take inspiration from the following chunking implementation? https://github.com/BaseMax/UnlimitedAutoTranslate/blob/2aec131f0b1de9fe34c5ae9876916aef4aef698d/UnlimitedAutoTranslate.py#L5 - It seems to use a max_limit of 4500 chars

@DavideGalilei
Copy link
Owner

It looks like that implementation splits the text on newlines; however, I was thinking about a more thoughtful approach in case the text doesn't have newlines. It might be possible to split also by punctuation and spaces.

@alsoGAMER alsoGAMER removed their assignment Apr 25, 2023
@DavideGalilei
Copy link
Owner

@powellnorma is this issue still present?

@powellnorma
Copy link
Author

Not sure, I haven't used this library in a while, and I don't have the text I used back then to test anymore, sorry.

Have you tried translating a >7k character text, e.g. lorem ipsum?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants