Comments (16)
Hey and thank you for helping me!
What kind of request do I need to make? And how should I use the response from it?
Thank you in advanceThis is the first call you should make to DeepL
https://gist.github.com/Marocco2/5268909dba2c450c214c240e90defb27The response is a JSON with your IP and the id you've created, meaning it's ready to translate.
DeepL server can check which gateway is coming the request, meaning that deploying the py module in a server could be blocked even with proxies, VPN and TORs
Keep in mind that this code is outdated. Once has worked, but it's too spaghetti to be recovered. I made a quick glance to your code and you did a much better job keeping it organized. You should fix it in no time with proper edits
I added your implementation of DeepL's RPC API in bb433ca !
from translate.
Hey and thank you for helping me!
What kind of request do I need to make? And how should I use the response from it?
Thank you in advance
This is the first call you should make to DeepL
https://gist.github.com/Marocco2/5268909dba2c450c214c240e90defb27
The response is a JSON with your IP and the id you've created, meaning it's ready to translate.
DeepL server can check which gateway is coming the request, meaning that deploying the py module in a server could be blocked even with proxies, VPN and TORs
Keep in mind that this code is outdated. Once has worked, but it's too spaghetti to be recovered. I made a quick glance to your code and you did a much better job keeping it organized. You should fix it in no time with proper edits
from translate.
Are you sure you are correctly connected to the internet?
Yes
(maybe a firewall blocking http connections?)
I checked the firewall rules - nothing like that
Thanks for the help, I found the main problem culprit - it turned out to be the old version of urllib3
from translate.
Also remember to update translatepy to v1.6
Thank you, I have already updated, although I installed it from the source code. I am preparing a PR for you so that Yandex Translator can start working correctly
from translate.
The problem with DeepL is that they seem to integrate some bot detection algorithm which I need to understand for it to work well.
The problem with pyppeteer is obviously the Chromium instance running with it which is way too heavy for something like translatepy
(already experimented it with my other, old translation module pyGoogleTranslate
)
For now, DeepL seems to work from my location but I guess that any kind of suspicious activity (even calling the API a few times will get me rate limited with the same message "Too many requests")
Also, try to use the Translator
class from translatepy.Translator
as some things are optimised with it (tip: you can use or not a service over another with the use_service arguments)
Translator(use_google=True, use_yandex=True, use_bing=True, use_reverso=True, use_deepl=True, yandex_sid_refresh=False)
from translate.
I'll close this issue since it didn't get any response for 10 days
from translate.
@Animenosekai Maybe I can help.
First, you need to send a getClientState json to DeepL to accept your "ticket" called id
From now on, your id is gonna increase by one every time you want to reach DeepL. This is the first step to make your request more "genuine"
from translate.
Hey and thank you for helping me!
What kind of request do I need to make? And how should I use the response from it?
Thank you in advance
from translate.
Some serious problem seems like:
from translate.
Some serious problem seems like:
Are you sure you are correctly connected to the internet? (maybe a firewall blocking http connections?)
What makes me say this is that this behaviour occurs when translatepy skipped all of the translators (and I just fixed it to just return None when there is no result, which is normally the expected value)
Also weird exception because I don't get any problem parsing the same URL with the same function:
But seeing this exception doesn't mean that it stopped there (hence the returned value) as translatepy
should not throw any exception from the Translator
class
from translate.
@ZhymabekRoman Yea thought so (it was very weird that urllib3 gave this exception while there were no mistake in the URL)
Also remember to update translatepy to v1.6 (pip install --upgrade translatepy
) because I fixed some things (should just give you None now instead of a TranslationResult with None in it in your case)
from translate.
@ZhymabekRoman Thank you!
Also, look at #4 to have an understanding of what we already tried to do with Yandex Translate 〜
from translate.
I will now close this issue as everything has been fixed in translatepy v1.6.1
from translate.
from time import sleep
from translatepy.translators.deepl import DeepL
dl = DeepL()
for elm in ['test this and that'] * 10:
print(dl.translate(elm, 'de'))
sleep(1)
# (None, None)
# (None, None)
# (None, None)
# (None, None)
# (None, None)
# (None, None)
# (None, None)
# (None, None)
# (None, None)
# (None, None)
Thanks for the hardwork. Sadly it still does not seem to work. Admittedly it works sometimes. Oftentimes it does not.
from translate.
from time import sleep from translatepy.translators.deepl import DeepL dl = DeepL() for elm in ['test this and that'] * 10: print(dl.translate(elm, 'de')) sleep(1) # (None, None) # (None, None) # (None, None) # (None, None) # (None, None) # (None, None) # (None, None) # (None, None) # (None, None) # (None, None)
Thanks for the hardwork. Sadly it still does not seem to work. Admittedly it works sometimes. Oftentimes it does not.
Hmmmm I'll look into but won't be able to make too much changes since it might conflict with what @ZhymabekRoman is doing in the v2
Also, try using the Translator
class from translatepy.Translator()
because it provides fixes on the language name, the words, caches and fallbacks (if you just want to use DeepL, try disabling the other ones with use_bing=False
, etc.)
from translate.
Admittedly it works sometimes. Oftentimes it does not.
Unfortunately seems this problem cannot be solved. I looked at all the implementations of the DeepL translator on the vastness of Github - no one works more or less stably. https://stackoverflow.com/questions/56114463/how-to-request-a-translation-from-deepl-at-the-moment
I analyzed the Windows version of the DeepL application and found out that it just opens the web address in a separate Chrome process - https://www.deepl.com/en/windows/translator?windows_app_version=2.3.0%2b6072bbdc (why then develop a separate application at all if it just opens a separate web page?). I opened this web page in a browser and tried to make a lot of translation requests, and it seems like I did not catch the error "Too many requests".
The only, as it seems to me, normal option is to use the official Deepl API Free. But it also has limitations-a maximum of 500,000 characters per month. I tried to register to get a free API key - it turns out that I need to link a bank card, but it does not support the countries of the post-Soviet states
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.