|
@@ -126,6 +126,8 @@ async def create_upload_file(file: UploadFile = File(...)):
|
|
|
|
|
|
@app.post("/make_anchor_video_v2")
|
|
|
async def make_anchor_video_v2(req:request):
|
|
|
+ if len(req.image_urls) != len(req.text_content):
|
|
|
+ return {'msg':'副標題數量、圖片(影片)數量以及台詞數量必須一致'}
|
|
|
for idx in range(len(req.image_urls)):
|
|
|
if 'http' not in req.image_urls[idx]:
|
|
|
req.image_urls[idx] = 'http://'+req.image_urls[idx]
|
|
@@ -150,6 +152,8 @@ async def make_anchor_video_v2(req:request):
|
|
|
|
|
|
@app.post("/make_anchor_video_eng")
|
|
|
async def make_anchor_video_eng(req:request_eng):
|
|
|
+ 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)):
|
|
|
if 'http' not in req.image_urls[idx]:
|
|
|
req.image_urls[idx] = 'http://'+req.image_urls[idx]
|