#8327 Network connection failedTraceback (most recent call last):

217.77**6 Posted at: 1 hour ago

Network connection failed
Traceback (most recent call last):
File "videotrans\translator\_base.py", line 79, in run
File "videotrans\translator\_base.py", line 117, in _run_text
File "tenacity\__init__.py", line 338, in wrapped_f
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 421, in exc_check
tenacity.RetryError: RetryError[]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\only_one.py", line 90, in run
File "videotrans\task\_stage_translate.py", line 31, in trans
File "videotrans\translator\_runner.py", line 71, in run
File "videotrans\translator\_base.py", line 85, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_deepl.py", line 40, in _item_task
File "deepl\translator.py", line 446, in translate_text
File "deepl\translator.py", line 203, in _raise_for_status
deepl.exceptions.DeepLException: Bad request, message: Bad request. Reason: Value for 'source_lang' not supported.

trk=[TransCreate]: uuid='99fce06049', proxy_str=None, cfg=[TaskCfgVTT]当前工作模式: 翻译视频 单视频模式
原始输入文件名: E:/Course/01_IntroToNiagara_Course/01_IntroToNiagara_Course/01_IntroToNiagara/01_IntroductionToTheCourse.mp4,
输出结果保存到文件夹: E:/Course/01_IntroToNiagara_Course/01_IntroToNiagara_Course/01_IntroToNiagara/_video_out/01_IntroductionToTheCourse-mp4,
临时文件夹: E:/win-pyvideotrans-v4.16/tmp/21684/99fce06049
已选 清理已存在
已启用CUDA加速
未选 降噪
STT Service:faster-whisper(Built-in), large-v3, 发音语言: English,
TranslateSrt:DeepL,原始语言:English,目标语言:Russian, 已选 SendSRT
TTS Service:Edge-TTS (Free), 角色:Dmitry(Male/RU), 配音语言:Russian, 未选 二次语音识别
音量:+0%, 语速:+0%, 已选 音频加速, 已选 视频慢速
已选 移除每条字幕配音开头和结尾静音缓冲
静音移除力度: default
字幕: Soft Subtitles , precent=12, hasend=False, should_recogn=True, should_trans=True, should_dubbing=True, should_hebing=True, is_copy_video=True, video_codec_num=264, ignore_align=False, is_audio_trans=False, clone_ref='', should_recogn2=False, do_diarize=True
video_duration_ms=137733


=
system:Windows-10-10.0.26200-SP0
version:v4.16
frozen:True
language:en_US
root_dir:E:/win-pyvideotrans-v4.16

1 Replies

#1 DeepSeek reply at 1 hour ago

Cause: The error comes from the DeepL channel, not from UI or network settings: Value for 'source_lang' not supported. pyVideoTrans passes the language code written in videotrans/languages.json for DeepL, which defaults to EN-US for English. DeepL accepts EN-US only as a target language, not as a source language — so the request is rejected with a 400/DeepLException, and the retry wrapper (tenacity.RetryError) aborts the translation stage.

Solution:

  1. Close the software.
  2. Open E:/win-pyvideotrans-v4.16/videotrans/languages.json with a plain-text editor (Notepad / VSCode).
  3. Find the "en" entry; its 4th element is the DeepL code:

    "en": ["en", "eng", "en", "EN-US", "en", "en", "en", "English", "en", "en"]
  4. Change "EN-US" to "EN" (keep this file strictly valid JSON: English half-width quotes, commas).
  5. Save, then restart the software and re-run the task with Clear Output enabled (or the cached empty/partial target SRT may be reused).
  6. If you translate to other languages too, check each language's DeepL code the same way: the source-side code must be the generic language code (e.g. ZH-HANS, JA, RU), and -US/-GB variants are only valid as targets.

Alternative: If editing JSON is inconvenient, switch the translation channel to DeepSeek / OpenAI / Gemini (excellent for English → Russian) or to Google/Microsoft (free) and re-run — no file editing needed.

请查阅相关文档:

Thinking...
Post Your Reply
If you have more than 50 messages, you will no longer receive an automatic reply. Please ask a new question!
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.

Dondate via ko-fi.com

Related resource