#8331 Network connection failed:Traceback (most recent call last): File

111.60**5 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\util\TestSrtTrans.py", line 19, in run
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.


=
system:Windows-10-10.0.22621-SP0
version:v4.16
frozen:True
language:zh_CN
root_dir:F:/chormedw/win-pyvideotrans-v4.16

1 Replies

#1 DeepSeek reply at 1 hour ago

The root cause: the source_lang value sent to DeepL is not a language code that DeepL accepts. In pyVideoTrans, your "Spoken language" (source) selection must be one that the DeepL channel maps to a valid DeepL code (e.g. Simplified Chinese = ZH-HANS). The typical triggers are:

  1. "Auto detect" was selected as the spoken language — DeepL requires an explicit source language, and an auto/unsupported value gets rejected.
  2. The source language you picked is not covered by DeepL (e.g. a minority language), or its mapping does not exist in videotrans/languages.json.

Solutions (in order):

  1. In the "Spoken" (source language) dropdown, pick the exact language the video is actually spoken in. Do not use "Auto detect" with DeepL.
  2. If the detected/picked language is a minority or rare language, DeepL won't support it. Switch the payment channel to an AI LLM translator instead (DeepSeek / OpenAI / Gemini etc.) — LLMs accept the natural language name and handle rare languages far better.
  3. If you are translating a common language (zh/en/ja/ko/fr/de/es...) and it still fails, verify that the source language you chose matches what DeepL lists as supported; then re-run with Clear Output checked.

If none of the above applies to your exact language pair, the problem is the code mapping itself. Please tell me:

  • the exact Spoken language and Target language you selected,
  • the DeepL plan (Free / Pro) and whether the API key works in the DeepL web console,
    so I can pinpoint the mapping mismatch.

Please refer to the related documentation:

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