Comments (13)
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.
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.
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.
Это обычная проблема с библиотекой, это связано с запросами 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.
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.
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.
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.
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.
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.
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.
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.
Closing for inactivity.
If you need further help on this topic, don't hesitate to reopen the ticket cc @simbadmorehod.
from gpytranslate.
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)
- unable to translate some texts HOT 1
- ConnectError exception while using a local proxy HOT 4
- httpx.ProxyError: [Errno -2] Name or service not known HOT 6
- about the proxy HOT 1
- Clients5.google.com is potentially dangerous HOT 1
- JSONDecodeError HOT 7
- [Bug]: Getting 302 Response HOT 3
- [Bug]: TypeError: Response.iter_bytes() got an unexpected keyword argument 'chunk_size' HOT 2
- [Issue]: While translating, getting unexpected error. HOT 2
- Library cannot be used in Python 3.6 and 3.7 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gpytranslate.