diff --git a/saas_web.py b/saas_web.py index 2f177f8..6f4cf34 100644 --- a/saas_web.py +++ b/saas_web.py @@ -1,8 +1,10 @@ """FastAPI upload UI for shrinking one media file through Codec Carver.""" +import json import tempfile import logging import shutil +import zipfile from pathlib import Path from fastapi import FastAPI, UploadFile, File, BackgroundTasks, Form, Request from fastapi.responses import HTMLResponse, FileResponse, JSONResponse @@ -11,6 +13,8 @@ app = FastAPI(title="Codec Carver SaaS") MAX_UPLOAD_BYTES = 5 * 1024 * 1024 * 1024 MAX_REQUEST_BYTES = MAX_UPLOAD_BYTES + 10 * 1024 * 1024 +MAX_BATCH_FILES = 20 +ALLOWED_UPLOAD_CONTENT_PREFIXES = ("audio/", "video/") class RequestTooLarge(Exception): @@ -208,6 +212,22 @@ async def add_security_headers(request: Request, call_next): }, false); +