feat: expand RF4 media inventory

This commit is contained in:
ik
2026-09-13 08:06:48 +07:00
parent 4042c80f00
commit 674bc5627f
9 changed files with 5054 additions and 19 deletions
+4 -2
View File
@@ -37,9 +37,9 @@ DEFAULT_STATE_FILE = Path(".cache/community-fetch-state.json")
ALLOWED_HOSTS = frozenset({
"download.rf4db.com", "rf4db.com",
"rf4-stat.ru",
"rf4map.ru",
"rf4map.ru", "gw.rf4map.ru", "hb.ru-msk.vkcloud-storage.ru",
"rf4-posts.com",
"rf4game.de",
"rf4game.de", "rf4game.ru",
})
MAX_RESPONSE_BYTES = 5 * 1024 * 1024 # 5 MB
@@ -105,6 +105,8 @@ def fetch_site_key(url: str) -> str:
hostname = hostname[4:]
if hostname.startswith("cdn."):
hostname = hostname[4:]
if hostname == "gw.rf4map.ru":
hostname = "rf4map.ru"
if not hostname:
raise ValueError("source URL must include a hostname")
return hostname