#5758 'NoneType' object has no attribute 'get':Traceback (most recent call last): File

14.191* Posted at: 4 days ago

'NoneType' object has no attribute 'get':Traceback (most recent call last):
File "videotrans\translator\_base.py", line 69, in run
File "videotrans\translator\_base.py", line 143, in _run_srt
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 63, in run
File "videotrans\translator\_base.py", line 72, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 79, in _item_task
AttributeError: 'NoneType' object has no attribute 'get'


=
system:Windows-10-10.0.19045-SP0
version:v4.04
frozen:True
language:en
root_dir:D:/pyvideotrans

1 Replies

The error 'NoneType' object has no attribute 'get' occurs in the OpenAI-compatible translation module (_openaicompat.py). This means the API returned None – usually due to an incorrect API key, invalid model name, or network/configuration issue.

1. Verify your API Key and Model

  • Go to Menu → Translation Settings and check the specific AI channel you're using (e.g., DeepSeek, OpenAI, etc.).
  • Ensure the API key is correct and has sufficient balance.
  • Make sure the model name (e.g., deepseek-v4-pro, gpt-4.1) is valid. If you're using a local LLM, confirm the service is running and the API address is http://127.0.0.1:port (not 0.0.0.0).

2. Check Network and Proxy

  • If you need a proxy for external services, enter it in the proxy field (format: http://127.0.0.1:port).
  • Try clearing the proxy field to bypass proxy and test again.
  • For Chinese users accessing domestic APIs (DeepSeek, Zhipu, etc.), no proxy is needed.

3. Adjust Advanced Settings

  • In Menu → Tools → Advanced Options → Subtitle Translation Adjustment, try increasing AI translation batch lines or decreasing the model's max_token value (set in the channel's own settings UI).

4. Test with a Simple Translation

  • Use the "Batch Translate SRT Subtitles" panel (left sidebar) with the same channel and a short subtitle file to isolate the issue.

If the problem persists, please share the latest log file from the logs/ folder (at least the last 30 lines) for a detailed diagnosis.

Please refer to:

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.

Dondate via ko-fi.com

Dondate via PayPal

Related resource