Skip to content

Commit

Permalink
Require ffmpeg when running script, else exit
Browse files Browse the repository at this point in the history
  • Loading branch information
Cammy committed May 7, 2019
1 parent 14d7974 commit 81eb26f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyinstalive/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def show_info():
logger.info("PyInstaLive version: {:s}".format(Constants.SCRIPT_VER))
logger.info("Python version: {:s}".format(Constants.PYTHON_VER))
if not command_exists("ffmpeg"):
logger.error("FFmpeg framework: Not found")
logger.error("FFmpeg framework: Not found")
else:
logger.info("FFmpeg framework: Available")

Expand Down
10 changes: 7 additions & 3 deletions pyinstalive/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,14 @@ def validate_inputs(config, args, unknown_args):
if not os.path.isfile(pil.ffmpeg_path):
pil.ffmpeg_path = None
cmd = "where" if platform.system() == "Windows" else "which"
logger.warn("Custom ffmpeg binary path is invalid, falling back to default path: {:s}".format(
subprocess.check_output([cmd, 'ffmpeg']).decode('UTF-8').rstrip()))
logger.warn("Custom FFmpeg binary path is invalid, falling back to environment variable.")
else:
logger.binfo("Overriding ffmpeg binary path: {:s}".format(pil.ffmpeg_path))
logger.binfo("Overriding FFmpeg binary path: {:s}".format(pil.ffmpeg_path))
else:
if not helpers.command_exists('ffmpeg') and not args.info:
logger.error("FFmpeg framework not found, exiting.")
logger.separator()
return False

if not pil.ig_user or not len(pil.ig_user):
raise Exception("Invalid value for 'username'. This value is required.")
Expand Down

0 comments on commit 81eb26f

Please sign in to comment.