Browse Source

add mp4 upload

ming 3 years ago
parent
commit
1cdf583131
1 changed files with 3 additions and 3 deletions
  1. 3 3
      api/main.py

+ 3 - 3
api/main.py

@@ -120,9 +120,9 @@ async def create_upload_file(file: UploadFile = File(...)):
     try:
         if file.content_type=='video/mp4':
             async with aiofiles.open(img_upload_folder+img_name+'.mp4', 'wb') as out_file:
-            content = await in_file.read()
-            await out_file.write(content) 
-        else :
+                content = await in_file.read()
+                await out_file.write(content) 
+        else:
             contents = await file.read()
             image = Image.open(io.BytesIO(contents))
             image= image.convert("RGB")