Giter Club home page Giter Club logo

Comments (13)

DavideGalilei avatar DavideGalilei commented on May 30, 2024 1

To check for errors, for now, you can catch json.JsonDecodeError exception. Anyway, if you really need 100% quality of work, I can suggest you to buy a subscription to paid google translate APIs, since they are reliable.

from gpytranslate.

simbadmorehod avatar simbadmorehod commented on May 30, 2024 1

You see, I'm from Russia, we don't pay until it's impossible to do it for free. We are trying to find this way)

from gpytranslate.

DavideGalilei avatar DavideGalilei commented on May 30, 2024

It's a common issue with the library, it's due to Google ratelimiting requests and giving a non-json answer which cannot get properly decoded by the library. I might add a custom exception for it, or if you have any advice, feel free to tell me :)

This is the reason why I added a proxy option, to avoid relying on a single ip address which may get temporarily blocked by google for too many requess.

from gpytranslate.

simbadmorehod avatar simbadmorehod commented on May 30, 2024

Это обычная проблема с библиотекой, это связано с запросами Google ratelimiting и выдачей не-json-ответа, который не может быть должным образом декодирован библиотекой. Я мог бы добавить для него собственное исключение, или, если у вас есть совет, не стесняйтесь сказать мне :)

Это причина, по которой я добавил опцию прокси, чтобы не полагаться на один IP-адрес, который может быть временно заблокирован Google для слишком большого количества запросов.

From the behavior it looks very much like a small "limit" of requests from one ip, does the proxi parameter solve the problem?

from gpytranslate.

DavideGalilei avatar DavideGalilei commented on May 30, 2024

Well, once you use proxies, each proxy will have its own ip which will get ratelimited, so you are just extending the limit to multiple ips. I don't think I can do anything about it since it's a limit on Google's side.

from gpytranslate.

simbadmorehod avatar simbadmorehod commented on May 30, 2024

It turns out that the number of successful requests depends on the number of proxies in the "clip" , is there a check for a positive response? Or another scenario for changing proxies? How does it work?

from gpytranslate.

DavideGalilei avatar DavideGalilei commented on May 30, 2024

Each Translator instance has its own proxy. Refer to examples to see how to use a proxy with the library. Though, you need to write the rotating proxy logic by yourself, since in my opinion it shouldn't be handled by the library (hence using multiple instances).

from gpytranslate.

simbadmorehod avatar simbadmorehod commented on May 30, 2024

I thought if there is a proxy, then it is worth to implement an automaton based on the blocking detector from google services from the condition of analysis which will happen again request, to guarantee 100% quality of work.

from gpytranslate.

simbadmorehod avatar simbadmorehod commented on May 30, 2024

Yes I understand, I'm a little worried because it will be my first experience with this kind of task, while I have no idea how to detect a failed response, apparently it comes "blank"?

from gpytranslate.

alsoGAMER avatar alsoGAMER commented on May 30, 2024

You see, I'm from Russia, we don't pay until it's impossible to do it for free. We are trying to find this way)

Well, I don't know what to tell you then.

from gpytranslate.

nocturn9x avatar nocturn9x commented on May 30, 2024

You see, I'm from Russia, we don't pay until it's impossible to do it for free. We are trying to find this way)

As a wise man once said: "Not my business nor my problem"

Have a nice day!

from gpytranslate.

alsoGAMER avatar alsoGAMER commented on May 30, 2024

Closing for inactivity.
If you need further help on this topic, don't hesitate to reopen the ticket cc @simbadmorehod.

from gpytranslate.

DavideGalilei avatar DavideGalilei commented on May 30, 2024

Fixed in #21 (now it should rate limit way less than before). I also added a custom exception (TranslationError) instead of thrown JsonDecodeError.

from gpytranslate.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.