feat: reconcile RF4DB media catalog
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user