Tu Nombre commited on
Commit
2b79235
·
1 Parent(s): 50a2078

endpoint descargar video

Browse files
Files changed (1) hide show
  1. cliente_template.py +8 -0
cliente_template.py CHANGED
@@ -234,6 +234,14 @@ import uvicorn
234
 
235
  app = FastAPI()
236
 
 
 
 
 
 
 
 
 
237
  @app.get("/", response_class=HTMLResponse)
238
  async def panel():
239
  yt_status = "✅ YouTube conectado" if os.path.exists("token.json") else "❌ YouTube NO conectado"
 
234
 
235
  app = FastAPI()
236
 
237
+ from fastapi.responses import FileResponse as _FR
238
+
239
+ @app.get("/descargar")
240
+ async def descargar_video():
241
+ if os.path.exists("out.mp4"):
242
+ return _FR("out.mp4", media_type="video/mp4", filename="tubebot_video.mp4")
243
+ return {"error": "Aun no hay video generado"}
244
+
245
  @app.get("/", response_class=HTMLResponse)
246
  async def panel():
247
  yt_status = "✅ YouTube conectado" if os.path.exists("token.json") else "❌ YouTube NO conectado"