|
@@ -1,4 +1,4 @@
|
|
|
-from fastapi import FastAPI,Cookie, Depends, FastAPI, Query, WebSocket, status
|
|
|
+from fastapi import FastAPI,Cookie, Depends, FastAPI, Query, WebSocket, status, WebSocketDisconnect
|
|
|
import openshot
|
|
|
from os import listdir
|
|
|
from os.path import isfile, isdir, join
|
|
@@ -121,17 +121,15 @@ async def make_anchor_video_v2(req:request2):
|
|
|
#return {"https://www.choozmo.com:8888/progress_page"}
|
|
|
return {"msg":"製作影片需要時間,請您耐心等候 稍後可以在www.choozmo.com:8168/"+req.name+".mp4 中觀看"}
|
|
|
|
|
|
-@app.websocket("/ws/{client_id}")
|
|
|
-async def websocket_endpoint(websocket: WebSocket, client_id: int):
|
|
|
+@app.websocket("/progress")
|
|
|
+async def websocket_endpoint(websocket: WebSocket):
|
|
|
await manager.connect(websocket)
|
|
|
try:
|
|
|
while True:
|
|
|
data = await websocket.receive_text()
|
|
|
- await manager.send_personal_message(f"You wrote: {data}", websocket)
|
|
|
await manager.broadcast(data)
|
|
|
except WebSocketDisconnect:
|
|
|
manager.disconnect(websocket)
|
|
|
- await manager.broadcast(f"Client #{client_id} left the chat")
|
|
|
|
|
|
|
|
|
|