# --------------------------------------------------------------------------- # # 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)
except httpx.RequestError as exc: raise HTTPException( status_code=status.HTTP_504_GATEWAY_TIMEOUT, detail=f"Error contacting remote host: exc", ) # app/main.py import time from collections import defaultdict from datetime import datetime, timedelta from typing import Dict heretic webdl
COPY . . ENV PORT=8000 EXPOSE 8000