Commenting the code and improved the detect_ffmpeg function
This commit is contained in:
parent
05a60c278c
commit
11e39cab08
@ -30,7 +30,7 @@ def main():
|
||||
if not ffmpeg_version:
|
||||
print(f"{BColors.FAIL}No ffmpeg version detected{BColors.ENDC}")
|
||||
exit()
|
||||
print(f"{BColors.OKBLUE}ffmpeg detected: {ffmpeg_version}{BColors.ENDC}")
|
||||
print(f"{BColors.OKBLUE}ffmpeg version detected: {ffmpeg_version}{BColors.ENDC}")
|
||||
|
||||
# Get/load command parameters
|
||||
directories = []
|
||||
|
||||
@ -9,13 +9,18 @@ from .bcolors import BColors
|
||||
|
||||
|
||||
def detect_ffmpeg():
|
||||
'''Returns the version of ffmpeg that is installed or false'''
|
||||
try:
|
||||
txt = subprocess.check_output(['ffmpeg', '-version'], stderr=subprocess.STDOUT).decode()
|
||||
return txt.partition('\n')[0]
|
||||
if "ffmpeg version" in txt:
|
||||
# Strip the useless text and
|
||||
return txt.split(' ')[2]
|
||||
except:
|
||||
pass
|
||||
return False
|
||||
|
||||
def user_confirm(question):
|
||||
'''Returns the user answer to a yes or no question'''
|
||||
answer = input(question)
|
||||
if answer.lower() in ["y","yes"]:
|
||||
return True
|
||||
@ -25,6 +30,7 @@ def user_confirm(question):
|
||||
return user_confirm(question)
|
||||
|
||||
def deletefile(filename):
|
||||
'''Delete a file, Returns a boolean'''
|
||||
try:
|
||||
os.remove(filename)
|
||||
except OSError:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user