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

94.139**1 Posted at: 1 day ago

'str' object has no attribute 'get':Traceback (most recent call last):
File "videotrans\translator\_base.py", line 82, in run
File "videotrans\translator\_base.py", line 165, 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 71, in run
File "videotrans\translator\_base.py", line 85, in run
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_openaicompat.py", line 100, in _item_task
AttributeError: 'str' object has no attribute 'get'


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

1 Replies

#1 DeepSeek reply at 1 day ago

This error means the OpenAI-compatible translation channel received a plain string instead of the expected JSON object, so .get() failed. In practice the API returned an error text / non-standard response rather than a valid chat completion.

Troubleshooting steps:

  1. Check the channel settings (Menu -> Translation Settings -> OpenAI / OpenAI-compatible): verify the API Base URL (e.g. https://api.openai.com/v1), API Key, and model name are correct. A wrong URL or model usually makes the endpoint return an error string, which triggers exactly this error.
  2. Verify the endpoint is truly OpenAI-compatible and supports /v1/chat/completions. Endpoints that only accept raw text or require different request formats will not work and must be placed in the dedicated compatible channel instead.
  3. Confirm the account has balance/quota and the key has permission for the selected model; quota/permission errors are often returned as plain text.
  4. Try a different model or switch to another provider (e.g. DeepSeek) to check whether the issue is provider-specific.
  5. In Advanced Options -> Translation, set Batch size (lines) for AI translation to 1 and clear the translation cache (tmp/translate_cache/) before retrying.

If the above does not resolve it, the exact cause cannot be determined from this traceback alone. Please provide the last ~30 lines of the latest log file in the software's logs/ folder (this will show the raw response returned by the API).

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