#8403 ERROR] 检测 google 翻译失败:Failed to parse: http=127.0.0.1:7897;https=127.0.0.1:7897;socks=127.0.0.1:7897Traceback (most rece

188.253**7 Posted at: 1 hour ago

ERROR] 检测 google 翻译失败:Failed to parse: http=127.0.0.1:7897;https=127.0.0.1:7897;socks=127.0.0.1:7897
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:7897;https=127.0.0.1:7897;socks=127.0.0.1:7897

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\translator\_runner.py", line 25, in _check_gorm
File "requests\api.py", line 73, in get
File "requests\api.py", line 59, in request
F
......
e '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:7897;https=127.0.0.1:7897;socks=127.0.0.1:7897

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "videotrans\task\job.py", line 35, in run
File "videotrans\task\job.py", line 138, in process_task
File "videotrans\task\translate_srt.py", line 51, in trans
File "videotrans\translator\_runner.py", line 75, in run
File "videotrans\translator\_base.py", line 69, in run
File "videotrans\translator\_base.py", line 107, 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 451, in result
File "concurrent\futures\_base.py", line 403, in __get_result
File "tenacity\__init__.py", line 480, in call
File "videotrans\translator\_microsoft.py", line 49, in _item_task
File "requests\api.py", line 115, in post
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:7897;https=127.0.0.1:7897;socks=127.0.0.1:7897
[ERROR] Failed to parse: http=127.0.0.1:7897;https=127.0.0.1:7897;socks=127.0.0.1:7897
Traceback (most recent call last):
File "urllib3\util\url.py", line 423, in parse_url
AttributeError: 'NoneType' object has no attribute 'groups'

1 Replies

#1 DeepSeek reply at 1 hour ago

这是因为代理地址填写格式错误导致所有网络请求失败。软件代理文本框只接受标准 URL 格式(如 http://127.0.0.1:7897),而你当前的代理值被解析成了 http=127.0.0.1:7897;https=127.0.0.1:7897;socks=127.0.0.1:7897(这是环境变量格式,不是 URL 格式),因此 requests 库解析 URL 时报 AttributeError: 'NoneType' object has no attribute 'groups',Google 检测失败并回退微软翻译后同样失败。

注意:该错误值可能是从系统环境变量 HTTP_PROXY/HTTPS_PROXY 中读取到的(软件在代理框为空时会回退读取系统环境变量)。

解决方案

1. 检查软件主界面代理框

主界面「对齐控制」行右侧的网络代理文本框,如果填的是上面那种 http=...;https=... 形式,请改为标准格式:

http://127.0.0.1:7897

如果不使用代理,直接清空该框。

2. 检查系统环境变量(很可能是这里的锅)

Windows 中:Win + R → 输入 sysdm.cpl → 高级 → 环境变量 → 检查「用户变量」和「系统变量」中是否有一项 HTTP_PROXY 或 HTTPS_PROXY,值若为 http=127.0.0.1:7897;https=... 这种不合法的 URL 格式,请:

  • 直接删除该变量,或
  • 改为 http://127.0.0.1:7897

修改完成后重启软件(必要时重启电脑或重启资源管理器让环境变量生效)。

3. 若代理软件(Clash/v2ray 等)开启了「系统代理」

部分代理软件会写入这种混合格式的环境变量,建议在代理软件中改为只设置 HTTP_PROXY=http://127.0.0.1:7897,或在系统设置中关闭自动写入,仅手动在 pyVideoTrans 代理框填写正确格式。

4. 验证

清空或改对后重新执行翻译,日志中不应再出现 Failed to parse: http=...。若 Google 仍失败,可先改用 微软(免费) 或 DeepSeek 渠道测试,确认网络已通。

请查阅相关文档:

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