Empower user to force using the file they selected

At least on Windows I got multiples times a detected type of 
`inode/blockdevice`. In reality files where good mp4 files accepted by 
peertube and youtube.
This commit is contained in:
Zykino 2020-04-19 15:26:16 +02:00
parent a1c472a5fa
commit 802d70b8d5

View file

@ -115,11 +115,17 @@ VALID_LANGUAGES = ('arabic', 'english', 'french',
def validateVideo(path):
supported_types = ['video/mp4']
if magic.from_file(path, mime=True) in supported_types:
return path
else:
detected_type = magic.from_file(path, mime=True)
if detected_type not in supported_types:
print("File", path, "detected type is", detected_type, "which is not one of", supported_types)
force_file = ['y', 'yes']
is_forcing = input("Are you sure you selected the correct file? (y/N)")
if is_forcing.lower() not in force_file:
return False
return path
def validateCategory(category):
if category.lower() in VALID_CATEGORIES: