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

46.201* Posted at: 2 days ago 👁24

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

1 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:

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