QPromise / EasyTrans

支持谷歌翻译、百度翻译、有道翻译的免费接口,基于Django、PyMuPDF实现了pdf文档英译汉的功能,翻译后的pdf格式基本保持不变,可以下载docx和pdf格式的翻译文档,基本解决复制caj中文论文时的格式问题,简单的满足看论文以及写总结的需求。
539 stars 138 forks source link

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

Open squarefaceyao opened 5 years ago

squarefaceyao commented 5 years ago

我点击网页上得翻译按钮会报错 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

QPromise commented 4 years ago

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