#3312 AttributeError: 'InvalidURL' object has no attribute 'message'

46.201* Posted at: 2 months ago 👁124

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 19, in run
File "videotrans\translator\__init__.py", line 983, in run
File "videotrans\translator\_base.py", line 103, in run
File "videotrans\translator\_base.py", line 124, 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 400, in
File "concurrent\futures\_base.py", line 439, in result
File "concurrent\futures\_base.py", line 391, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_libre.py", line 51, in _item_task
File "requests\api.py", line 115, in post
File "requests\api.py", line 59, in request
File "requests\sessions.py", line 575, in request
File "requests\sessions.py", line 484, in prepare_request
File "requests\models.py", line 367, in prepare
File "requests\models.py", line 444, in prepare_url
requests.exceptions.InvalidURL: Invalid URL 'http:/translate': No host supplied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\util\TestSrtTrans.py", line 30, in run
File "videotrans\configure\_except.py", line 431, in get_msg_from_except
File "videotrans\configure\_except.py", line 293, in
AttributeError: 'InvalidURL' object has no attribute 'message'


=
system:Windows-10-10.0.26200-SP0
version:v3.97
frozen:True
language:en
root_dir:D:/AI_Tools/pyvideotrans

3 Replies

This error is caused by an incorrectly configured LibreTranslate API URL in the translation channel settings. The URL 'http:/translate' is missing a slash and the hostname.

Solution:

  1. In the main software interface, go to the "Translation Channel" settings.
  2. Select the "LibreTranslate" channel.
  3. In the "API URL" field, enter the correct address of your LibreTranslate service. The standard format is http://localhost:5000 (if running locally) or the full URL of your deployed service (e.g., https://your-libretranslate-instance.com).
  4. Ensure the URL is complete, including the protocol (http:// or https://) and the correct port number if applicable.
  5. Click "Test Connection" to verify the configuration is correct before using it for translation tasks.

Please refer to the relevant documentation:

Traceback (most recent call last):
File "urllib3\util\url.py", line 423, in parse_url
AttributeError: 'NoneType' object has no attribute 'groups'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "requests\adapters.py", line 610, in send
File "requests\adapters.py", line 453, in get_connection_with_tls_context
File "requests\utils.py", line 985, in prepend_scheme_if_needed
File "urllib3\util\url.py", line 449, in parse_url
urllib3.exceptions.LocationParseError: Failed to parse: http://127.0.0.1:33210

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\job.py", line 148, in run
File "videotrans\task\_translate_srt.py", line 45, in trans
File "videotrans\translator\__init__.py", line 861, in run
File "videotrans\translator\_base.py", line 81, in run
File "videotrans\translator\_base.py", line 99, 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 400, in
File "concurrent\futures\_base.py", line 439, in result
File "concurrent\futures\_base.py", line 391, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_google.py", line 40, in _item_task
File "requests\api.py", line 73, in get
File "requests\api.py", line 59, in request
File "requests\sessions.py", line 589, in request
File "requests\sessions.py", line 703, in send
File "requests\adapters.py", line 614, in send
requests.exceptions.InvalidURL: Failed to parse: http://127.0.0.1:33210

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\job.py", line 158, in run
File "videotrans\configure\_except.py", line 480, in get_msg_from_except
File "videotrans\configure\_except.py", line 332, in
AttributeError: 'InvalidURL' object has no attribute 'message'


=
system:Windows-10-10.0.19045-SP0
version:v3.84
frozen:True
language:zh
root_dir:F:/桌面/win-videotrans-v3.84

This error is caused by an invalid network proxy address format in the software's settings. The proxy URL http://127.0.0.1:33210 is being parsed incorrectly, likely due to a missing colon or incorrect syntax.

Solution:

  1. In the main interface of pyVideoTrans, locate the "Network Proxy Address" input field.
  2. Ensure the proxy address is entered in the correct format: http://127.0.0.1:33210 or socks5://127.0.0.1:10808. The format must be 协议://IP地址:端口号.
  3. If you are not using a proxy or are unsure, leave this field completely empty. An incorrectly formatted proxy address will cause connection failures for services like Google Translate.
  4. After correcting or clearing the field, try the translation task again.

请查阅相关文档:

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