|
@@ -403,7 +403,7 @@ async def make_anchor_video(req:models.request,token: str = Depends(oauth2_schem
|
|
|
return {'msg':'ok'}
|
|
|
|
|
|
@app.post("/make_anchor_video_eng")
|
|
|
-async def make_anchor_video_eng(req:models.request_eng):
|
|
|
+async def make_anchor_video_eng(req:models.request_eng,token: str = Depends(oauth2_scheme)):
|
|
|
if len(req.image_urls) != len(req.sub_titles) or len(req.sub_titles) != len(req.text_content):
|
|
|
return {'msg':'副標題數量、圖片(影片)數量以及台詞數量必須一致'}
|
|
|
for idx in range(len(req.image_urls)):
|
|
@@ -419,8 +419,8 @@ async def make_anchor_video_eng(req:models.request_eng):
|
|
|
im= im.convert("RGB")
|
|
|
except:
|
|
|
return {'msg':"無法辨別圖片網址"+imgu}
|
|
|
-
|
|
|
- video_id = save_history(req,name_hash)
|
|
|
+ user_id = get_user_id(token)
|
|
|
+ video_id = save_history(req,name_hash, user_id)
|
|
|
x = threading.Thread(target=gen_video_queue_eng, args=(name_hash,req.name, req.text_content, req.image_urls,req.sub_titles,int(req.avatar),video_id))
|
|
|
x.start()
|
|
|
return {"msg":"ok"}
|