About

Heretic Webdl Link -

class Settings: # ---- security / abuse limits ------------------------------------------------- MAX_CONTENT_LENGTH = int(os.getenv("MAX_CONTENT_LENGTH", "104857600")) # 100 MiB # Optional whitelist (comma‑separated). If empty → allow any domain. WHITELISTED_DOMAINS = set( filter(None, os.getenv("WHITELISTED_DOMAINS", "").split(",")) ) # Rate limiting – simple token bucket stored in memory (good enough for free tier) RATE_LIMIT = int(os.getenv("RATE_LIMIT", "10")) # requests per minute per IP

# 3️⃣ Install deps pip install -r requirements.txt heretic webdl

# --------------------------------------------------------------------------- # # Core: async generator that streams the remote response to the caller. # --------------------------------------------------------------------------- # async def stream_remote_file(url: str) -> AsyncGenerator[bytes, None]: """ Yield chunks from the remote URL, respecting the global size limit. """ parsed = _validate_url(url) class Settings: # ---- security / abuse limits

# 2️⃣ Create a virtualenv python3 -m venv venv source venv/bin/activate heretic webdl

app = FastAPI( title="Heroku Web‑DL", description="A tiny HTTP API that streams any publicly reachable file back to the caller.", version="0.1.0", )