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."