check if the player exist or not

This commit is contained in:
trymelz 2019-01-01 18:29:57 -06:00
parent 0930bb1a0c
commit 60e035cca8

View File

@ -273,7 +273,12 @@ def matchall(text, patterns):
def launch_player(player, urls):
import subprocess
import shlex
import shutil
exefile=shlex.split(player)[0]
if shutil.which(exefile) is not None:
subprocess.call(shlex.split(player) + list(urls))
else:
log.wtf('[Failed] Cannot find player "%s"' % exefile)
def parse_query_param(url, param):