添加虎牙自动注册

This commit is contained in:
yml2213
2026-07-06 00:31:34 +08:00
parent 3f50d962a0
commit af98ea8416
12 changed files with 1060 additions and 19 deletions
+6 -1
View File
@@ -54,7 +54,12 @@ class HuyaSmsCodeResult:
def normalize_huya_phone(phone: str) -> str:
"""归一化虎牙短信接口手机号格式。"""
digits = "".join(ch for ch in str(phone or "") if ch.isdigit())
raw = str(phone or "").strip()
digits = "".join(ch for ch in raw if ch.isdigit())
if raw.startswith("+1") and len(digits) == 11:
return f"001{digits[1:]}"
if digits.startswith("001") and len(digits) == 13:
return digits
if digits.startswith("086"):
return digits
if digits.startswith("86") and len(digits) == 13: