diff --git a/mps_youtube/init.py b/mps_youtube/init.py index 5da9207f..ed408126 100644 --- a/mps_youtube/init.py +++ b/mps_youtube/init.py @@ -39,13 +39,16 @@ def init(): # set player to mpv or mplayer if found, otherwise unset suffix = ".exe" if mswin else "" - mplayer, mpv = "mplayer" + suffix, "mpv" + suffix + mplayer, mpv, vlc = "mplayer" + suffix, "mpv" + suffix, "vlc" + suffix if not os.path.exists(g.CFFILE): if has_exefile(mpv): config.PLAYER.set(mpv) + elif has_exefile(vlc): + config.PLAYER.set(vlc) + elif has_exefile(mplayer): config.PLAYER.set(mplayer) @@ -53,7 +56,12 @@ def init(): else: config.load() - assign_player(config.PLAYER.get) # Player is not assigned when config is loaded + try: + assign_player(config.PLAYER.get) # Player is not assigned when config is loaded + except FileNotFoundError: + print("Configured player " + config.PLAYER.get + " does not exist.") + print("A new one must be specified by the command 'set player ' within the app") + input("Press Enter to continue") _init_readline() cache.load()