Ebook Translator:用 Calibre 翻译多格式双语对照电子书

延伸阅读

给这篇文章写一条留言

提示:带 * 标记的是必填项。您填写的邮箱地址将会被保密。首次留言将会在通过人工审核后显示。如果是提出问题,请务必提供尽可能多信息,这有助于他人更好地理解你所提出的问题。

小伙伴们写下了 290 条留言

  1. 使用DeepL(Free)翻译报错:
    Traceback (most recent call last):
    File “calibre_plugins.ebook_translator.engines.base”, line 171, in get_result
    br.open(request)
    File “mechanize/_mechanize.py”, line 257, in open
    File “mechanize/_mechanize.py”, line 313, in _mech_open
    mechanize._response.get_seek_wrapper_class..httperror_seek_wrapper: HTTP Error 429:

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “calibre_plugins.ebook_translator.components.engine”, line 66, in translate_text
    translation = self.translator.translate(text)
    File “calibre_plugins.ebook_translator.engines.deepl”, line 125, in translate
    return self.get_result(
    File “calibre_plugins.ebook_translator.engines.base”, line 181, in get_result
    raise Exception(_(‘Can not parse returned response. Raw data: {}’)
    Exception: 无法解析返回的响应。原始数据:
    Traceback (most recent call last):
    File “calibre_plugins.ebook_translator.engines.base”, line 171, in get_result
    br.open(request)
    File “mechanize/_mechanize.py”, line 257, in open
    File “mechanize/_mechanize.py”, line 313, in _mech_open
    mechanize._response.get_seek_wrapper_class..httperror_seek_wrapper: HTTP Error 429:

  2. 插件翻译的文件阅读卡顿报错怎么解决? 翻译的文件超链接丢失。目录翻译有吗?

    calibre, version 6.23.0

    错误: 未处理的异常: TimeoutError:Timed out waiting for: pause

    calibre 6.23 embedded-python: True
    Windows-10-10.0.22631-SP0 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.22631’)
    Python 3.10.1
    Windows: (’10’, ‘10.0.22631’, ‘SP0’, ‘Multiprocessor Free’)
    Interface language: zh_CN
    Successfully initialized third party plugins: Ebook Translator (2, 1, 1)
    Traceback (most recent call last):
    File “calibre\gui2\viewer\tts.py”, line 95, in action
    File “calibre\gui2\viewer\tts.py”, line 123, in stop
    File “calibre\gui2\tts\windows.py”, line 154, in stop
    File “calibre\utils\windows\winspeech.py”, line 442, in pause
    File “calibre\utils\windows\winspeech.py”, line 424, in wait_for
    TimeoutError: Timed out waiting for: pause

    • 卡顿的问题可能和书本身有关系。译文目前不会保留链接。目录只翻译内容中的目录,Kindle“前往”导航中的目录不会翻译。这个错误提示是在做什么操作时出现的?

  3. 请问翻译时候出现:无法解析返回的响应。原始数据:应该怎么处理呢?谢谢.网络正常,已科学上网,用的chatgpt的api

  4. 启用词汇表后,只保留译文情况,输出为:
    关于作者 约翰-多克尼亚斯 是2021年不列颠哥伦比亚省冠军。他曾在大太平洋公开赛、兰利公开赛和2017年加拿大U18锦标赛等多项强手如林的比赛中夺冠。约翰是一名国际象棋教师,拥有超过9年的教学经验,并为著名的国家国际象棋出版物做注释。维多利亚-多克尼亚斯(Victoria Doknjas),工商管理硕士,是北美青年国际象棋锦标赛(2014年和2017年)和2015年世界青年和少年国际象棋锦标赛(希腊)的加拿大代表团团长。她赢得了2016年加拿大高级女子冠军头衔,并共同创办了青少年国际象棋学院。作者:John Doknjas 现代贝诺尼 西西里纳伊多夫 重演 (与Joshua Doknjas合著)

  5. 报错,不知何意。

    calibre, version 6.23.0
    错误: 未处理的异常: TypeError:stat: path should be string, bytes, os.PathLike or integer, not NoneType

    calibre 6.23 embedded-python: True
    macOS-13.4.1-arm64-arm-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘22.5.0’, ‘Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:23 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6020’)
    Python 3.10.1
    OSX: (‘13.4.1’, (”, ”, ”), ‘arm64’)
    Interface language: zh_CN
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 2, 0) && Package KFX (from KFX Input) (2, 2, 0) && Douban Books (3, 2, 0) && Ebook Translator (2, 1, 1) && KFX metadata reader (from KFX Input) (2, 2, 0) && KFX Input (2, 2, 0) && Set KFX metadata (from KFX Output) (2, 0, 0) && KFX Output (2, 0, 0) && KOReader Sync (0, 5, 2)
    Traceback (most recent call last):
    File “calibre_plugins.ebook_translator.batch”, line 122, in
    lambda: self.translate_ebooks(self.ebooks))
    File “calibre_plugins.ebook_translator.batch”, line 135, in translate_ebooks
    if not to_library and not os.path.exists(output_path):
    File “genericpath.py”, line 19, in exists
    TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

      • 不知何故,calibre升级,插件升级后,一切正常了。可以顺当的完成翻译到打包AZW3的全过程。

  6. 这个版本批量翻译书籍超过重试次数后,自动输出未翻译完全的书籍.
    这就会导致每一次都要翻日志,看看是不是完成翻译还是未完成翻译,然后再重新翻译
    因为我用的deepl,free.经常会受到每日限制.我自己通过不断改IP地址逃脱限制
    以前出错了,我还能知道哪些没翻译完成,继续翻译

  7. 打开缓存时显示错误代码:
    calibre, version 6.23.0
    错误: 未处理的异常: TypeError:int() argument must be a string, a bytes-like object or a real number, not ‘NoneType’

    calibre 6.23 embedded-python: True
    Windows-10-10.0.19041-SP0 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.10.1
    Windows: (’10’, ‘10.0.19041’, ‘SP0’, ‘Multiprocessor Free’)
    Interface language: zh_CN
    Successfully initialized third party plugins: Ebook Translator (2, 1, 1)
    Traceback (most recent call last):
    File “calibre_plugins.ebook_translator.ui”, line 131, in show_cache
    File “calibre_plugins.ebook_translator.cache”, line 37, in __init__
    File “calibre_plugins.ebook_translator.cache”, line 104, in table_widget
    File “calibre_plugins.ebook_translator.cache”, line 201, in __init__
    File “calibre_plugins.ebook_translator.cache”, line 206, in wrapper
    File “calibre_plugins.ebook_translator.cache”, line 228, in refresh
    File “calibre_plugins.ebook_translator.lib.cache”, line 120, in get_list
    TypeError: int() argument must be a string, a bytes-like object or a real number, not ‘NoneType’

  8. 关于ChatGPT 用合并翻译,再版本1.3.8及之前有一个取巧的方式:观察没有标记的段落(即排版错误翻译挤成一坨的地方),稍微改变下原文。不需要修改太多,比如把某个逗号替换成句号,或者加一个空格符即可。接下来重新用ChatGPT翻译这本书,之前排版正确的段落会从缓存中提取,错误的段落会重新翻译。
    但是这种方法再2.0.0之后失效了。请问可以修复吗?

    • 出现这种情况,是旧版本没有检查缓存是否重复的一个副作用,因此在新版本中不再有效。新版本中的高级模式不能解决这个问题吗?

  9. HTTP请求中的重试次数能否设置的均匀一些,比如每隔5分钟重试一次,而不是重复次数越多等待的时间越长?

  10. 遇到了一个问题,用高级模式的Google(Free)把简体转换为繁体时,一级目录正常,而二级目录不能正常关联,点击目录时无法转到正确的章节,请问怎么解决?

      • 两个导航都有问题。
        一级目录(第一章、第二章……)可以正常关联,而二级目录(每个章节里的小节一、二……)不能正常关联。
        虽然这个问题可以用Sigil修复,但还是想反馈一下,如果表述不准确请见谅。

  11. 无法解析返回的响应。原始数据:’utf-8′ codec can’t decode byte 0xc4 in position 4: invalid continuation byte

    是不是DeepL通道封掉了?

    • 不是。不知 DeepL 改动的什么导致原来的请求数据出了问题,近两天要发布的版本会修复这个问题。

  12. 之前一直使用deepl(free) ,但这两天忽然不行了(测试了谷歌free,还是可以连接上)
    显示说是:
    无法解析返回的响应。原始数据:’utf-8′ codec can’t decode byte 0xc4 in position 4: invalid continuation byte

  13. 我不小心把chatgpt openai的提示词给删了,请问它原始的提示词是什么?

    • 删除提示词输入框中的所有文字,可以看到默认提示词。删除提示词也没关系,插件会自动使用默认提示词。

  14. GPT3.5测试正常,GPT4测试显示无法解析返回的响应。原始数据:HTTP Error 404: Not Found

  15. 这是新的报错

    翻译已完成。
    Traceback (most recent call last):
    File “sre_parse.py”, line 1039, in parse_template
    KeyError: ‘\\U’

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “runpy.py”, line 196, in _run_module_as_main
    File “runpy.py”, line 86, in _run_code
    File “site.py”, line 83, in
    File “site.py”, line 78, in main
    File “site.py”, line 50, in run_entry_point
    File “calibre\utils\ipc\worker.py”, line 215, in main
    File “calibre\utils\ipc\worker.py”, line 150, in arbitrary_n
    File “calibre_plugins.ebook_translator.convertion”, line 94, in convert_book
    File “calibre\ebooks\conversion\plumber.py”, line 1281, in run
    File “calibre_plugins.ebook_translator.convertion”, line 88, in convert
    File “calibre_plugins.ebook_translator.element”, line 328, in add_translations
    File “calibre_plugins.ebook_translator.element”, line 118, in add_translation
    File “re.py”, line 209, in sub
    File “re.py”, line 326, in _subx
    File “re.py”, line 317, in _compile_repl
    File “sre_parse.py”, line 1042, in parse_template
    re.error: bad escape \U at position 86

        • 这次不会。只有当需要修改和抽取内容或缓存相关的功能,且无法兼容老版本时,才会导致老版本缓存失效。今后更新时,如果出现不兼容老版本缓存的情况,会在发布时说明。

  16. 翻译完成后无法保存,保存任何格式都会
    ————————————————–
    译文:
    ==============================
    翻译已完成。
    Traceback (most recent call last):
    File “runpy.py”, line 196, in _run_module_as_main
    File “runpy.py”, line 86, in _run_code
    File “site.py”, line 83, in
    File “site.py”, line 78, in main
    File “site.py”, line 50, in run_entry_point
    File “calibre\utils\ipc\worker.py”, line 215, in main
    File “calibre\utils\ipc\worker.py”, line 150, in arbitrary_n
    File “calibre_plugins.ebook_translator.convertion”, line 94, in convert_book
    File “calibre\ebooks\conversion\plumber.py”, line 1281, in run
    File “calibre_plugins.ebook_translator.convertion”, line 88, in convert
    File “calibre_plugins.ebook_translator.element”, line 328, in add_translations
    File “calibre_plugins.ebook_translator.element”, line 127, in add_translation
    File “src/lxml/etree.pyx”, line 3233, in lxml.etree.XML
    File “src/lxml/parser.pxi”, line 1913, in lxml.etree._parseMemoryDocument
    File “src/lxml/parser.pxi”, line 1793, in lxml.etree._parseDoc
    File “src/lxml/parser.pxi”, line 1082, in lxml.etree._BaseParser._parseUnicodeDoc
    File “src/lxml/parser.pxi”, line 615, in lxml.etree._ParserContext._handleParseResultDoc
    File “src/lxml/parser.pxi”, line 725, in lxml.etree._handleParseResult
    File “src/lxml/parser.pxi”, line 654, in lxml.etree._raiseParseError
    File “”, line 1
    lxml.etree.XMLSyntaxError: Premature end of data in tag p line 1, line 1, column 45