利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.
Python ai-video-generatorcontent-creationffmpeginstagram-reelsllmpythonshort-videosubtitlestext-to-speechtiktokvideo-automationvideo-workflowworkflow-automationyoutube-shorts
feat: enable cors to allow play video through mounted videos url
kevin.zhang3b1871d59187
diff --git a/app/asgi.py b/app/asgi.pyindex 440e4c08..d21a7244 100644--- a/app/asgi.py+++ b/app/asgi.py@@ -1,10 +1,12 @@"""Application implementation - ASGI."""+import osfrom fastapi import FastAPI, Requestfrom fastapi.exceptions import RequestValidationErrorfrom fastapi.responses import JSONResponsefrom loguru import loggerfrom fastapi.staticfiles import StaticFiles+from fastapi.middleware.cors import CORSMiddlewarefrom app.config import configfrom app.models.exception import HttpException@@ -47,6 +49,17 @@ def get_application() -> FastAPI:app = get_application()+# Configures the CORS middleware for the FastAPI app+cors_allowed_origins_str = os.getenv("CORS_ALLOWED_ORIGINS", "")+origins = cors_allowed_origins_str.split(",") if cors_allowed_origins_str else ["*"]+app.add_middleware(+ CORSMiddleware,+ allow_origins=origins,+ allow_credentials=True,+ allow_methods=["*"],+ allow_headers=["*"],+)+task_dir = utils.task_dir()app.mount("/tasks", StaticFiles(directory=task_dir, html=True, follow_symlink=True), name="")