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

deepl翻译只读取,不翻译 #380

Closed
yangchen859 opened this issue Jan 30, 2024 · 5 comments
Closed

deepl翻译只读取,不翻译 #380

yangchen859 opened this issue Jan 30, 2024 · 5 comments

Comments

@yangchen859
Copy link

这是我在rapidapi测试, 是能够翻译的
image

我使用的是这个命令, 不太确定是不是这样使用python make_book.py --book_name test_books/animal_farm.epub --model deepl --deepl_key 5a1745ee92xxxsh16xxxxxxxxxxp1563fejsn2347d9025e6f --language ja 这个命令时, 翻译只能读取到文本, 但是不会翻译

image

@yangchen859
Copy link
Author

发现问题: deepl_translator.py 中
self.headers = { "content-type": "application/json", "X-RapidAPI-Key": "", "X-RapidAPI-Host": "deepl-translator.p.rapidapi.com", }
替换为
self.headers = { "content-type": "application/json", "X-RapidAPI-Key": "", "X-RapidAPI-Host": "dpl-translator.p.rapidapi.com", }
就可以翻译了

@yihong0618
Copy link
Owner

发现问题: deepl_translator.py 中 self.headers = { "content-type": "application/json", "X-RapidAPI-Key": "", "X-RapidAPI-Host": "deepl-translator.p.rapidapi.com", } 替换为 self.headers = { "content-type": "application/json", "X-RapidAPI-Key": "", "X-RapidAPI-Host": "dpl-translator.p.rapidapi.com", } 就可以翻译了

来个 pr?

@yihong0618
Copy link
Owner

发现问题: deepl_translator.py 中 self.headers = { "content-type": "application/json", "X-RapidAPI-Key": "", "X-RapidAPI-Host": "deepl-translator.p.rapidapi.com", } 替换为 self.headers = { "content-type": "application/json", "X-RapidAPI-Key": "", "X-RapidAPI-Host": "dpl-translator.p.rapidapi.com", } 就可以翻译了

你这俩没区别啊

@yihong0618
Copy link
Owner

有区别,我傻逼了

@yihong0618
Copy link
Owner

@yangchen859 按照你的代码 fix 了,在 commit 里面加了感谢,谢谢你

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

2 participants