mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
18 lines
523 B
Python
18 lines
523 B
Python
|
|
from src.services.utils.upload_content import upload_content
|
|
|
|
|
|
async def upload_video(video_file, activity_uuid, org_uuid, course_uuid):
|
|
contents = video_file.file.read()
|
|
video_format = video_file.filename.split(".")[-1]
|
|
|
|
try:
|
|
await upload_content(
|
|
f"courses/{course_uuid}/activities/{activity_uuid}/video",
|
|
org_uuid,
|
|
contents,
|
|
f"video.{video_format}",
|
|
)
|
|
|
|
except Exception:
|
|
return {"message": "There was an error uploading the file"}
|