mirror of
https://github.com/soimort/you-get.git
synced 2025-01-24 05:55:02 +03:00
check if the player exist or not
This commit is contained in:
parent
0930bb1a0c
commit
60e035cca8
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user