#3574 TaskCfgSTS(is_cuda=False, uuid='d173eab66c', cache_folder=None, target_dir='C:/Users/msi/Downloads/Video', source_langua

1.54* Posted at: 5 hours ago 👁9

Trans Error [Gemini AI] Connection refused, target service may not be running or wrong port
Traceback (most recent call last):
File "httpx\_transports\default.py", line 101, in map_httpcore_exceptions
File "httpx\_transports\default.py", line 250, in handle_request
File "httpcore\_sync\connection_pool.py", line 216, in handle_request
File "httpcore\_sync\connection_pool.py", line 196, in handle_request
File "httpcore\_sync\connection.py", line 99, in handle_request
File "httpcore\_sync\connection.py", line 76, in handle_request
File "httpcore\_sync\connection.py", line 122, in _connect
File "httpcore\_backends\sync.py", line 205, in connect_tcp
File "contextlib.py", line 153, in exit
File "httpcore\_exceptions.py", line 14, in map_exceptions
httpcore.ConnectError: [WinError 10061] No connection could be made because the target machine actively refused it

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 990, in run
File "videotrans\translator\_base.py", line 101, in run
File "videotrans\translator\_base.py", line 164, 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 400, in
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_gemini.py", line 104, in _item_task
File "google\genai\models.py", line 5407, in generate_content_stream
File "google\genai\models.py", line 4101, in _generate_content_stream
File "google\genai\_api_client.py", line 1405, in request_streamed
File "google\genai\_api_client.py", line 1224, in _request
File "tenacity\__init__.py", line 477, in call
File "tenacity\__init__.py", line 378, in iter
File "tenacity\__init__.py", line 420, in exc_check
File "tenacity\__init__.py", line 187, in reraise
File "concurrent\futures\_base.py", line 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "google\genai\_api_client.py", line 1188, in _request_once
File "httpx\_client.py", line 914, in send
File "httpx\_client.py", line 942, in _send_handling_auth
File "httpx\_client.py", line 979, in _send_handling_redirects
File "httpx\_client.py", line 1014, in _send_single_request
File "httpx\_transports\default.py", line 249, in handle_request
File "contextlib.py", line 153, in exit
File "httpx\_transports\default.py", line 118, in map_httpcore_exceptions
httpx.ConnectError: [WinError 10061] No connection could be made because the target machine actively refused it
TaskCfgSTS(is_cuda=False, uuid='d173eab66c', cache_folder=None, target_dir='C:/Users/msi/Downloads/Video', source_language=None, source_language_code='Simplified Chinese', source_sub='C:/Users/msi/Downloads/Video/3月11日.srt', source_wav=None, source_wav_output=None, target_language=None, target_language_code='Vietnamese', target_sub='C:/Users/msi/Downloads/Video/3月11日.Vietnamese.srt', target_wav=None, target_wav_output=None, name='C:/Users/msi/Downloads/Video/3月11日.srt', noextname='3月11日', basename='3月11日.srt', ext='srt', dirname='C:/Users/msi/Downloads/Video', shound_del_name=None, translate_type=5)


=
system:Windows-10-10.0.19045-SP0
version:v3.98
frozen:True
language:en
root_dir:C:/Users/msi/Downloads/Compressed/win-pyvideotrans-v3.98

3 Replies

The error "Connection refused, target service may not be running or wrong port" indicates that pyVideoTrans cannot connect to the Gemini AI API service. This is a network connectivity issue.

Solution Steps:

  1. Check Internet Connection: Ensure your computer has a stable internet connection.
  2. Configure Network Proxy (if needed): If you are in a region that requires a proxy/VPN to access Google services (like Gemini), you must configure the proxy in pyVideoTrans.

    • In the main interface, find the "Network Proxy" input box.
    • Enter your proxy address in the format: http://127.0.0.1:7860 (replace with your actual proxy server and port).
  3. Verify Gemini API Key and Region: Ensure your Gemini API Key is correctly entered in Menu -> Translation Settings -> Gemini AI Settings. Also, confirm that the API service is available in your region.
  4. Temporarily Disable Firewall/Antivirus: Sometimes, security software may block the connection. Try temporarily disabling your firewall or antivirus to test.
  5. Use an Alternative Translation Channel: If the connection issue persists, consider switching to another AI translation channel (e.g., DeepSeek, OpenAI) or a traditional translation channel.

If the problem continues after these steps, please provide the latest log file from the logs/ folder in your software installation directory for further analysis.

Please refer to the relevant documentation:

.

The error "Connection refused" indicates a network connectivity issue preventing pyVideoTrans from reaching the Gemini AI API server.

Solution Steps:

  1. Check Internet Connection: Ensure your computer has a stable internet connection.
  2. Configure Network Proxy (if needed): If you are in a region that requires a proxy/VPN to access Google services, you must configure it in the software.

    • In the main interface, find the "Network Proxy" input box.
    • Enter your proxy address in the format: http://127.0.0.1:7860 (replace with your actual proxy server and port).
  3. Verify Gemini API Key: Ensure your Gemini API Key is correctly entered in Menu -> Translation Settings -> Gemini AI Settings.
  4. Temporarily Disable Firewall/Antivirus: Security software may block the connection. Try temporarily disabling them to test.
  5. Use an Alternative Translation Channel: If the issue persists, switch to another AI translation channel (e.g., DeepSeek, OpenAI) or a traditional translation channel.

If the problem continues, please provide the latest log file from the logs/ folder in your software installation directory for further analysis.

请查阅相关文档:

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