-
Notifications
You must be signed in to change notification settings - Fork 729
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 in result (AttributeError: 'NoneType' object has no attribute 'group') #234
Comments
It seems the problem comes from such as network environment, rate limits. Could you provide your environment info, e.g. OS, ISP(your network provider), etc. Also please let me know whether it's okay from translate.google.com. |
I am getting this error too. It was starting 28 october. Win8.1 last updated, Python version 3.6.6, googletrans 3.0.0, |
same here. In a list of 10 words to translate, 2 or 3 would generate the error. |
i test it on ubuntu server and windows 10 but not work |
Could you let me know your location and internet service provider? and did you check if it's working on translate.google.com? Because this library is not an official implementation I need you to check your network condition or elaborate on what's giving your problem so that I can confirm this issue and help you. |
Russia, Rostov on Don, ISP: Megalink. translate.goole.com is working without problems. |
I'm also getting same issue. |
Note sure if it's related, but over on gTTS they have similar issues with accessing google translate, but then for text-to-speech. One user reported that switching from urllib.requests to requests fixed the issue: It might be worthwhile experimenting with vanilla requests instead of httpx... |
I've tried reproducing this several times but so far I don't think I can easily reproduce this in my environment (from the major ISPs in South Korea: Korea Telecom, SK Broadband, and U+.)
However, I'm investigating this issue further right now and will get back to you shortly - I believe it's related to something strange happening with Google's anti-spamming work. If someone else has experienced similar or the same issues please submit to this issue with such details as ISPs, location, and whether it happens consistently at all or not. |
Using it over a VPN, it has failed for me for servers in multiple countries over UDP. I'd rather not say specifics as to which ones. I added in try/except loop that makes it try a random new proxy if a query fails, but even so I can't seem to escape these failures. It works for a seemingly-random number of queries before failing (nowhere near 300, probably ~20 at the most). Using Ubuntu 20.04, Python 3.8.3, googletrans 3.0.0. |
Thanks for your information. I will try testing on other networks using proxies. |
I upgraded httpx to the latest version (in spite of pip complaining it's not compatible with py-googletrans), and the stability seems to be back to how it was before... Could be a coincidence though. |
Could you guys here test this and let me know if it fixes the issue? |
i test it |
i also got this error right now. |
But after i try it on my other computer with Linux Ubuntu 18.04 (never install the "googletrans"), it performed okay. So i think it might be banned by Google, and it'll be banned for a long time. |
I'm actually having the same issue running googletrans inside a docker container. The error would stop all the processes of the container, but as soon as i restart the container, googletrans is not returning any error for the current process. |
Hi all, |
I faced this behaviour as after a certain period of time a new request submit works fine ... |
This problem occurs if you create a Translator instance for each use of the request. This problem can be partially avoided by using only one instance of the class. |
@VOINTENT: Implemented as of, got stability back ! Thx mate |
Thanks, it worked when using only one instance of the class. |
Tried the one instance solution worked for a while but now it's back. |
Worked for me. Quite interestingly, changing the service URL to |
|
|
Using Python 3.7 and googletrans==4.0.0rc1 worked like a charm for me! :D |
This is still an issue. Use |
the issue is still present for bulk translations |
I have the same issue Using python 3.7.6 and googletrans==4.0.0rc1 |
googletrans 3.0.0 which, at the time of writing, is the released version with Python 3.9.6, macOS 11.5, ISP is BT in the United Kingdom and the 'NoneType object has no attribute group...' issue is a problem for me. It is obvious from the error trace that the problem lies in: RE_TKK.search(r.text) which is returning None. Under what circumstances would it do that? |
Could you explain how to do that with an example please? |
I met this issue also, and I fixed it by removing the param "service_urls" when constructing the "Translator()" from
to
hope this helps :) |
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\googletrans\gtoken.py", line 62, in _update Author used regex for parse html :( |
Doesn't work for me even using only one instance. |
What worked for me today was
(solution from https://stackoverflow.com/a/69271089/7292383) |
|
best solution here: |
I fixed it with with changing the the service_urls with the non web version: |
this url was removed... returns 404 |
Python 3.12.2 (main, Feb 6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin |
googletrans==4.0.0rc1, pythonwin 3.11.4 - works perfectly too |
* fix: issue ssut#234 - extend service url to direct api fix: issue ssut#234 - manage use of translate.googleapis.com which does not need token * fix: issue ssut#234 - extend use of direct api fix: issue ssut#234 - manage use of translate.googleapis.com which does not need token * fix: issue ssut#234 - extend use of direct api fix: issue ssut#234 - manage use of translate.googleapis.com which does not need token * fix: issue ssut#234 - extend use of direct api fix: issue ssut#234 - manage use of translate.googleapis.com which does not need token * fix: issue ssut#234 - extend use of direct api fix: issue ssut#234 - manage use of translate.googleapis.com which does not need token
…leapis.com (possible fix for ssut#234)
hi i use Python 3.6.9
and when i call translate have this error:
The text was updated successfully, but these errors were encountered: