feat: Implement Telegram bot with Claude authentication, mail service, and identity spoofing, refactoring core logic into new modules. #1

Open
mygo-kyx wants to merge 13 commits from mygo-kyx/autoClaude-TGbot:main into Feature-FromFork-Kunkun
Showing only changes of commit d6948591a1 - Show all commits

View File

@@ -62,6 +62,15 @@ def _parse_line(line: str) -> Proxy | None:
if not line or line.startswith("#"):
return None
# 优先检查完整 URL 格式(必须在 colon-split 之前,否则会被错误匹配)
if line.startswith(("http://", "https://", "socks5://")):
try:
from urllib.parse import urlparse
parsed = urlparse(line)
return Proxy(raw=line, url=line, host=parsed.hostname or "?", port=str(parsed.port or "?"))
except Exception:
return None
parts = line.split(":")
if len(parts) == 4:
host, port, user, passwd = parts
@@ -71,14 +80,6 @@ def _parse_line(line: str) -> Proxy | None:
host, port = parts
url = f"http://{host}:{port}"
return Proxy(raw=line, url=url, host=host, port=port)
elif line.startswith(("http://", "https://", "socks5://")):
# 从完整 URL 提取 host:port
try:
from urllib.parse import urlparse
parsed = urlparse(line)
return Proxy(raw=line, url=line, host=parsed.hostname or "?", port=str(parsed.port or "?"))
except Exception:
return None
return None