QPromise/EasyTrans

无法正确运行,如何解决?

Opened this issue · 1 comments

我点击网页上得翻译按钮会报错
Internal Server Error: /bing_trans/
Traceback (most recent call last):
File "C:\Users\Envs\EasyTrans_env\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\Envs\EasyTrans_env\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\Envs\EasyTrans_env\lib\site-packages\django\core\handlers\base.py", line 113, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\Envs\EasyTrans_env\lib\site-packages\django\views\decorators\csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "C:\Users\SquareFace\Downloads\EasyTrans\EasyTrans\trans\views.py", line 77, in bing_trans
bing_trans_content = translate_func.bing_translate(content)
File "C:\Users\SquareFace\Downloads\EasyTrans\EasyTrans\trans\translate_func.py", line 133, in bing_translate
res = requests.post(url, data={'text':content.replace('\n',''), 'from': 'en', 'to': "zh-CHS", 'doctype': 'json'}).json()['translationResponse']
File "C:\Users\Envs\EasyTrans_env\lib\site-packages\requests\models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "c:\programdata\anaconda3\Lib\json_init
.py", line 348, in loads
return _default_decoder.decode(s)
File "c:\programdata\anaconda3\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "c:\programdata\anaconda3\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[28/Oct/2019 20:38:14] "POST /bing_trans/ HTTP/1.1" 500 19501

bing翻译接口已失效,正在改进。