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
error intranslation #395
Comments
I am having the same issue. it worked a week ago, now I'm receiving a 404 error whenever I call detect_language() |
i thought it might be the issue regarding urllib.requests, so I changed the method of request through "requests", but the error was the same. I looked through the reverse engineering process in _calculate_tk function and tried to change it, but I am not having any success. |
I won't have time to look into this myself, but if someone sends a PR to fix this, I would merge it. |
Even though I I am using 0.15.3 (which is one version lower than the latest, which has been reported not to have the "translate" option in more), the translate option keeps returning a very similar error than the one above linked ("HTTP Error 404: Not Found"). |
I found that some parameters of the interface changed, and the format returned after the modification was different. In translate.py, the url was changed to |
Hey, I checked your suggestion for the new URL. after changing the URL the translate function no longer returns a 404. Don't know what other impacts it has. Do you suppose you will initiate a Pull Request with your fix? |
@zc520yzy Thank you. That fixed that. |
I suggest using the above URL directly, but this will affect the current business. Because the returned data has changed, the above URL is feasible. I have tested it
…---Original---
From: ***@***.***>
Date: 2021/9/20 07:08:00
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [sloria/TextBlob] error intranslation (#395)
@zc520yzy Thank you. That fixed that.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
|
Use Googletrans to translate the text import googletrans translater = Translator() To detect the language we can use this... |
@sloria : would be great if you could merge & update PR :) |
Linux batch: Docker image (add this to your docker file): |
@sloria any updates on merging the fix? |
url not found error sometime:
File "/usr/local/lib/python3.8/dist-packages/textblob/blob.py", line 546, in translate
return self.class(self.translator.translate(self.raw,
File "/usr/local/lib/python3.8/dist-packages/textblob/translate.py", line 54, in translate
response = self.request(url, host=host, type=type_, data=data)
File "/usr/local/lib/python3.8/dist-packages/textblob/translate.py", line 92, in _request
resp = request.urlopen(req)
File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.8/urllib/request.py", line 531, in open
response = meth(req, response)
File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
response = self.parent.error(
File "/usr/lib/python3.8/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
The text was updated successfully, but these errors were encountered: