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

HTTP Error 400: Bad Request #4

Open
yeahman45 opened this issue Dec 9, 2021 · 4 comments
Open

HTTP Error 400: Bad Request #4

yeahman45 opened this issue Dec 9, 2021 · 4 comments

Comments

@yeahman45
Copy link

I have tried the sample.py and I am getting this error (I am using python 3.7):

/SubtitleTranslate-master/util_trans.py", line 73, in __post
    response = urllib.request.urlopen(request)
  File "/usr/lib/python3.7/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.7/urllib/request.py", line 563, in error
    result = self._call_chain(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 755, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/lib/python3.7/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.7/urllib/request.py", line 641, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python3.7/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 503, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.7/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
@Doublefire-Chen
Copy link

Me too!

@zhijia2
Copy link

zhijia2 commented Jan 23, 2022

me too

@sadgen
Copy link

sadgen commented Nov 14, 2022

api url已经失效。如果可以访问Google,把util_trans.py里的__translate函数中goolge.cn改成google.com即可。

@EmilioSchi
Copy link

Change the base url at 78 line.

I resolve write this:
url = "http://translate.googleapis.com/translate_a/single?client=t" \

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