Skip to content
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

404 Error #62

Open
eddieberklee opened this issue Mar 24, 2023 · 4 comments
Open

404 Error #62

eddieberklee opened this issue Mar 24, 2023 · 4 comments

Comments

@eddieberklee
Copy link

Here's the error I'm getting:

`Traceback (most recent call last):
File "/opt/homebrew/lib/python3.9/site-packages/google_trans_new/google_trans_new.py", line 189, in translate
r.raise_for_status()
File "/opt/homebrew/lib/python3.9/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://translate.google.cn/_/TranslateWebserverUi/data/batchexecute

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/elee/android-projects/etils-translator/main.py", line 216, in
translateToFile(file)
File "/Users/elee/android-projects/etils-translator/main.py", line 166, in translateToFile
translated = translate(english_string, existing_country_folder.country_code)
File "/Users/elee/android-projects/etils-translator/main.py", line 141, in translate
return google_trans_new.google_translator()
File "/opt/homebrew/lib/python3.9/site-packages/google_trans_new/google_trans_new.py", line 194, in translate
raise google_new_transError(tts=self, response=r)
google_trans_new.google_trans_new.google_new_transError: 404 (Not Found) from TTS API. Probable cause: Unknown`

@Veivel
Copy link

Veivel commented Mar 27, 2023

I've been getting the exact same issue. I figured the URL may be causing an issue, so I tried to change the url_suffix parameter of the google_translator object. Didn't work. My internet is working fine.

@ifhjl
Copy link

ifhjl commented Apr 13, 2023

Me too still have problem using it

@Ericocococo
Copy link

google_translator(url_suffix="com") replace default (url_suffix="cn") ,have a try.

@chrk623
Copy link

chrk623 commented Mar 27, 2024

As of March 27 2024, i needed to change the following lines in google_translator.translate:

# remove
response = (decoded_line + ']')

# change
response = json.loads(response)
# to
response = json.loads(decoded_line)

As for detect, this works: #60 (comment)

Are PRs still accepted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants