Remove project OAuth hardcodes

This commit is contained in:
Your Name
2026-08-03 17:23:35 +05:00
parent 65c15e59d1
commit 6b873b3aee
6 changed files with 117 additions and 15 deletions
+4 -2
View File
@@ -192,8 +192,10 @@ def normalize_vk_source(value: str) -> str:
raw = str(value or "").strip()
if not raw:
return ""
if "vk.com" in raw:
raw = raw.split("vk.com", 1)[1]
for host in ("vk.com", "vk.ru", "m.vk.com"):
if host in raw:
raw = raw.split(host, 1)[1]
break
raw = raw.lstrip("/")
raw = raw.split("?", 1)[0].split("#", 1)[0].strip()
raw = re.sub(r"^(club|public)", "", raw, flags=re.IGNORECASE)