fix: telethon HTTP proxy format - use dict instead of string

This commit is contained in:
GongyiChuren
2026-06-01 00:48:10 +08:00
parent 4f95cf7845
commit 81a5cf25b9
+4
View File
@@ -657,6 +657,10 @@ def _build_telethon_proxy(proxy: str) -> Any:
except ImportError:
logger.warning("pysocks not installed, cannot use socks proxy")
return None
if p.startswith("http://") or p.startswith("https://"):
from urllib.parse import urlparse
u = urlparse(p)
return {"proxy_type": "http", "addr": u.hostname, "port": u.port, "username": u.username, "password": u.password}
return p