import os

DATABASE_URL       = os.environ["DATABASE_URL"]
FLARESOLVERR_URL   = os.getenv("FLARESOLVERR_URL", "http://flaresolverr:8191")

# Delays between requests (seconds)
LIST_MIN_DELAY  = float(os.getenv("CRAWLER_LIST_MIN_DELAY", "2.0"))
LIST_MAX_DELAY  = float(os.getenv("CRAWLER_LIST_MAX_DELAY", "4.0"))
BAND_MIN_DELAY  = float(os.getenv("CRAWLER_BAND_MIN_DELAY", "1.5"))
BAND_MAX_DELAY  = float(os.getenv("CRAWLER_BAND_MAX_DELAY", "2.5"))
ENRICH_LIMIT    = int(os.getenv("CRAWLER_ENRICH_LIMIT", "500"))
# Cooldown pause every N band pages
COOLDOWN_EVERY  = int(os.getenv("CRAWLER_COOLDOWN_EVERY", "60"))
COOLDOWN_MIN    = float(os.getenv("CRAWLER_COOLDOWN_MIN", "15"))
COOLDOWN_MAX    = float(os.getenv("CRAWLER_COOLDOWN_MAX", "30"))

# FlareSolverr request timeout (ms)
FS_TIMEOUT_MS  = int(os.getenv("CRAWLER_FS_TIMEOUT_MS", "90000"))

# How many bands to request per AJAX page (max MA allows)
AJAX_PAGE_SIZE  = int(os.getenv("CRAWLER_AJAX_PAGE_SIZE", "500"))

# Schedules (hours between runs, 0 = disabled)
SCHED_INCREMENTAL_H = int(os.getenv("CRAWLER_SCHED_INCREMENTAL_H", "4"))
SCHED_ENRICH_H      = int(os.getenv("CRAWLER_SCHED_ENRICH_H", "1"))
# Full crawl: day of month (1-28), 0 = disabled
SCHED_FULL_DAY      = int(os.getenv("CRAWLER_SCHED_FULL_DAY", "1"))

MA_BASE = "https://www.metal-archives.com"
