mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 08:43:58 +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):
|
def launch_player(player, urls):
|
||||||
import subprocess
|
import subprocess
|
||||||
import shlex
|
import shlex
|
||||||
subprocess.call(shlex.split(player) + list(urls))
|
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):
|
def parse_query_param(url, param):
|
||||||
|
Loading…
Reference in New Issue
Block a user