Comments (4)
Great @Animenosekai ! I read the code from translatepy\utils\request.py And as you said, it will change the proxy ip on each request. So, I supose this issue is solved.
if self._proxies_index != len(self.proxies) - 1: self._proxies_index += 1 else: self._proxies_index = 0
Thank you!
Btw it is recommended to use the Translator
class instead of just the DeeplTranslate
one, (you could pass the DeeplTranslate
class first in Translator
if you want their answer first and add the other ones to fallback like so:
>>> from translatepy.translators import GoogleTranslate, DeeplTranslate, ReversoTranslate, BingTranslate
>>> from translatepy import Translate
>>> from translatepy.utils.request import Request
>>>
>>> translator = Translate(services_list=[DeeplTranslate, GoogleTranslate, BingTranslate, ReversoTranslate], request=Request(proxy_urls=["<proxy_one>", "<proxy_two>"]))
>>>
>>> translator.translate("Hello", "Japanese")
TranslationResult(service=DeepL, source=Hello, source_language=jpn, destination_language=jpn, result=Hello)
)
from translate.
translate_html
was primarily designed for the Translate class but now that you mention it I could add a parameter to use a blocking method
without being blocked
No DeepL has way too strict rate limits and no one has found a solution to this issue
from translate.
@davidmartinrius Thinking about it, you just need to pass threads_limit=1
to process in only one thread.
Also, Request()
changes to the next proxy on each request, so it will change to a different proxy in each thread.
from translate.
Great @Animenosekai !
I read the code from translatepy\utils\request.py And as you said, it will change the proxy ip on each request.
So, I supose this issue is solved.
if self._proxies_index != len(self.proxies) - 1:
self._proxies_index += 1
else:
self._proxies_index = 0
Thank you!
from translate.
Related Issues (20)
- The `example` function in `YandexTranslate` without translation HOT 7
- Bulk Translation support? HOT 2
- NoResult: No service has returned a valid result HOT 8
- Missing spaces between tags when using translate_html HOT 2
- Bing Translator throwing error code 205 HOT 5
- Not accurate source language autodetection HOT 14
- Language auto detecting is broken in MyMemory HOT 3
- example() not working HOT 1
- Next: 3.0 HOT 24
- Different Translation on Yandex HOT 11
- Result mismatch Google Translate HOT 5
- MicrosoftTranslate.text_to_speech is not working HOT 8
- Is the DeepL split text correct? HOT 3
- [SERVER]: cannot import name 'General' from 'nasse.config' HOT 1
- the lang tr is not supported by deepl error (even though it has) HOT 1
- How to set timeout for Translate requesting? HOT 8
- Links and hashtags seem to change after translation HOT 10
- ReversoTranslator BUG HOT 7
- No module named 'translatepy.utils' (on Windows) HOT 2
- Traditional Chinese 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 translate.