File size: 499 Bytes
5338741
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
def validate_video_file(file):
    allowed_extensions = ['mp4', 'mov', 'avi', 'mkv']
    if not file.name.split('.')[-1] in allowed_extensions:
        return False, "Invalid file type. Please upload a video file (mp4, mov, avi, mkv)."
    
    return True, "File is valid."

def validate_video_duration(duration, max_duration=60):
    if duration > max_duration:
        return False, f"Video duration exceeds the maximum limit of {max_duration} seconds."
    
    return True, "Duration is valid."