aliSaac510 commited on
Commit
ecb075e
·
1 Parent(s): 834dd13

Fix: Ensure caption_style is passed correctly in styles.py, and secure firebase credentials.

Browse files
Files changed (1) hide show
  1. main.py +16 -0
main.py CHANGED
@@ -1,6 +1,7 @@
1
  from fastapi import FastAPI, UploadFile, File, Form, HTTPException
2
  from fastapi.responses import JSONResponse, FileResponse
3
  from fastapi.openapi.utils import get_openapi
 
4
  from typing import Optional, List
5
  from enum import Enum
6
  import os
@@ -126,6 +127,8 @@ class Language(str, Enum):
126
 
127
  app = FastAPI(
128
  title="🎬 Auto-Clipping API",
 
 
129
  description="""
130
  ## Auto-Clipping API
131
 
@@ -172,6 +175,19 @@ Automatically extract **viral-worthy clips** from long-form videos using AI.
172
  ]
173
  )
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  clipper = VideoProcessor()
176
 
177
  # ─────────────────────────────────────────────
 
1
  from fastapi import FastAPI, UploadFile, File, Form, HTTPException
2
  from fastapi.responses import JSONResponse, FileResponse
3
  from fastapi.openapi.utils import get_openapi
4
+ from fastapi.openapi.docs import get_swagger_ui_html
5
  from typing import Optional, List
6
  from enum import Enum
7
  import os
 
127
 
128
  app = FastAPI(
129
  title="🎬 Auto-Clipping API",
130
+ docs_url=None, # Disable default /docs
131
+ redoc_url=None, # Disable default /redoc
132
  description="""
133
  ## Auto-Clipping API
134
 
 
175
  ]
176
  )
177
 
178
+ # ─────────────────────────────────────────────
179
+ # Custom Root Swagger UI
180
+ # ─────────────────────────────────────────────
181
+ @app.get("/", include_in_schema=False)
182
+ async def custom_swagger_ui_html():
183
+ return get_swagger_ui_html(
184
+ openapi_url=app.openapi_url,
185
+ title=app.title + " - Swagger UI",
186
+ oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url,
187
+ swagger_js_url="https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js",
188
+ swagger_css_url="https://unpkg.com/swagger-ui-dist@5/swagger-ui.css",
189
+ )
190
+
191
  clipper = VideoProcessor()
192
 
193
  # ─────────────────────────────────────────────