studio / utils /validators.py
Ava2lon's picture
Upload 170 files
345855e verified
Raw
History Blame
274 Bytes
import os
ALLOWED = [".mp4", ".mov", ".mkv"]
def validate_video(path):
if not os.path.exists(path):
raise Exception("File not found")
ext = os.path.splitext(path)[1].lower()
if ext not in ALLOWED:
raise Exception("Unsupported video format")