#3712 TaskCfgSTS(is_cuda=False, uuid='16abcc229b', cache_folder=None, target_dir='D:/漫剧存储/中文在线-漫剧存储/黎明之剑', source_language=Non

128.14* Posted at: 2 hours ago 👁12

翻译字幕阶段出错 [DeepSeek] 网络连接失败
Traceback (most recent call last):
File "httpx\_transports\default.py", line 101, in map_httpcore_exceptions
File "httpx\_transports\default.py", line 127, in iter
File "httpcore\_sync\connection_pool.py", line 367, in iter
File "httpcore\_sync\connection_pool.py", line 363, in iter
File "httpcore\_sync\http11.py", line 349, in iter
File "httpcore\_sync\http11.py", line 341, in iter
File "httpcore\_sync\http11.py", line 210, in _receive_response_body
File "httpcore\_sync\http11.py", line 220, in _receive_event
File "contextlib.py", line 153, in exit
File "httpcore\_exceptions.py", line 14, in map_exceptions
httpcore.RemoteProtocolError: peer closed connection without sending complete message body (incomplete chunked read)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "openai\_base_client.py", line 1005, in request
File "httpx\_client.py", line 928, in send
File "httpx\_client.py", line 922, in send
File "httpx\_models.py", line 881, in read
File "httpx\_models.py", line 897, in iter_bytes
File "httpx\_models.py", line 951, in iter_raw
File "httpx\_client.py", line 153, in iter
File "httpx\_transports\default.py", line 126, in iter
File "contextlib.py", line 153, in exit
File "httpx\_transports\default.py", line 118, in map_httpcore_exceptions
httpx.RemoteProtocolError: peer closed connection without sending complete message body (incomplete chunked read)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "videotrans\task\job.py", line 173, in run
File "videotrans\task\_translate_srt.py", line 44, in trans
File "videotrans\translator\__init__.py", line 981, in run
File "videotrans\translator\_base.py", line 101, in run
File "videotrans\translator\_base.py", line 164, in _run_srt
File "videotrans\translator\_deepseek.py", line 47, in _item_task
File "openai\_utils\_utils.py", line 286, in wrapper
File "openai\resources\chat\completions\completions.py", line 1211, in create
File "openai\_base_client.py", line 1297, in post
File "openai\_base_client.py", line 1037, in request
openai.APIConnectionError: Connection error.
TaskCfgSTS(is_cuda=False, uuid='16abcc229b', cache_folder=None, target_dir='D:/漫剧存储/中文在线-漫剧存储/黎明之剑', source_language=None, source_language_code='Simplified Chinese', source_sub='D:/漫剧存储/中文在线-漫剧存储/黎明之剑/黎明之剑1-40.srt', source_wav=None, source_wav_output=None, target_language=None, target_language_code='Spanish', target_sub='D:/漫剧存储/中文在线-漫剧存储/黎明之剑/黎明之剑1-40.Spanish.srt', target_wav=None, target_wav_output=None, name='D:/漫剧存储/中文在线-漫剧存储/黎明之剑/黎明之剑1-40.srt', noextname='黎明之剑1-40', basename='黎明之剑1-40.srt', ext='srt', dirname='D:/漫剧存储/中文在线-漫剧存储/黎明之剑', shound_del_name=None, translate_type=4)


=
system:Windows-10-10.0.22631-SP0
version:v3.98
frozen:True
language:zh
root_dir:D:/pyvideotrans

3 Replies

报告网络出错,请问是为什么

这是由于 DeepSeek API 连接不稳定或网络问题导致的远程协议错误。

  1. 降低并发和请求频率:在 菜单 -> 工具 -> 高级选项 中,进行以下调整:

    • AI翻译渠道每批字幕行数:减少到 10 或更小。
    • 翻译后暂停秒:增加到 3-5 秒。
    • 发送完整字幕:如果勾选了,请取消勾选,以减少单次请求的数据量。
  2. 检查网络连接和代理

    • 如果您在中国大陆地区使用 DeepSeek,请确保已配置正确的网络代理。在主界面的“网络代理地址”中填写您的代理地址(例如 http://127.0.0.1:10808)。
    • 如果您没有代理,DeepSeek 服务可能无法稳定连接。
  3. 验证 API 配置:检查 菜单 -> 翻译设置 -> DeepSeek 中的 API URL 和 API Key 是否正确。DeepSeek 的 API URL 应为 https://api.deepseek.com
  4. 分批处理:如果字幕文件非常大,可以尝试将 SRT 文件拆分为多个较小的文件分批翻译。

请查阅相关文档:

这是由于 DeepSeek API 连接不稳定或网络问题导致的远程协议错误。

  1. 降低并发和请求频率:在 菜单 -> 工具 -> 高级选项 中,进行以下调整:

    • AI翻译渠道每批字幕行数:减少到 10 或更小。
    • 翻译后暂停秒:增加到 3-5 秒。
    • 发送完整字幕:如果勾选了,请取消勾选,以减少单次请求的数据量。
  2. 检查网络连接和代理:如果您在中国大陆地区使用 DeepSeek,请确保已配置正确的网络代理。在主界面的“网络代理地址”中填写您的代理地址(例如 http://127.0.0.1:10808)。如果您没有代理,DeepSeek 服务可能无法稳定连接。
  3. 验证 API 配置:检查 菜单 -> 翻译设置 -> DeepSeek 中的 API URL 和 API Key 是否正确。DeepSeek 的 API URL 应为 https://api.deepseek.com
  4. 分批处理:如果字幕文件非常大,可以尝试将 SRT 文件拆分为多个较小的文件分批翻译。

请查阅相关文档:

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Related resource