feat: reconcile RF4DB media catalog
CI / backend-and-migrations (push) Canceled after 0s
CI / astro-build (push) Canceled after 0s
CI / dependency-audit (push) Canceled after 0s
CI / compose-e2e (push) Canceled after 0s

This commit is contained in:
ik
2026-09-14 07:45:29 +07:00
parent 0eca44c11a
commit 61c7ac7d51
9 changed files with 3593 additions and 12 deletions
+6 -4
View File
@@ -35,7 +35,7 @@ USER_AGENT = "RF4-Spotter/0.1 (authorized data integration)"
MIN_FETCH_INTERVAL_SECONDS = 30 * 60
DEFAULT_STATE_FILE = Path(".cache/community-fetch-state.json")
ALLOWED_HOSTS = frozenset({
"download.rf4db.com", "rf4db.com",
"download.rf4db.com", "rf4db.com", "oss.rf4db.com",
"rf4-stat.ru",
"rf4map.ru", "gw.rf4map.ru", "hb.ru-msk.vkcloud-storage.ru",
"rf4-posts.com",
@@ -99,11 +99,13 @@ def fetch_site_key(url: str) -> str:
hostname = (urlsplit(url).hostname or "").lower()
if hostname.startswith("www."):
hostname = hostname[4:]
if hostname.startswith("download."):
if hostname.endswith(".rf4db.com"):
hostname = "rf4db.com"
elif hostname.startswith("download."):
hostname = hostname[9:]
if hostname.startswith("api."):
elif hostname.startswith("api."):
hostname = hostname[4:]
if hostname.startswith("cdn."):
elif hostname.startswith("cdn."):
hostname = hostname[4:]
if hostname == "gw.rf4map.ru":
hostname = "rf4map.ru"