# System deps RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential && rm -rf /var/lib/apt/lists/*
# We need to fetch the headers *once* to get the MIME type. # Using httpx HEAD request (fast, no body) – fallback to generic if unavailable. import httpx async with httpx.AsyncClient(follow_redirects=True, timeout=10) as client: try: head = await client.head(payload.url, follow_redirects=True) if head.status_code == 200: ct = head.headers.get("Content-Type") if ct: headers["Content-Type"] = ct except Exception: # ignore – we will stream anyway pass heretic webdl
# 4️⃣ (optional) set env vars in a .env file cp .env.example .env # edit .env as needed # System deps RUN apt-get update && apt-get