diff --git a/contrib/downloadboob/downloadboob.py b/contrib/downloadboob/downloadboob.py index f8ec20989402c90d8666782f1cd9b6bd480895c2..1ce0452fdcdf244f96061eb44a20aabfa003f0c0 100755 --- a/contrib/downloadboob/downloadboob.py +++ b/contrib/downloadboob/downloadboob.py @@ -231,7 +231,7 @@ def check_exec(executable): else: return 1 - os.spawnlp(os.P_WAIT, args[0], *args) + subprocess.call(args) self.set_linkname(video) def read_url(self, url): diff --git a/weboob/applications/radioob/radioob.py b/weboob/applications/radioob/radioob.py index aa023cc343dce35140f9c43a2016b3c8c67f1dd4..4e96e7d21989e7372378f15e4052ec5e20d2a3b6 100644 --- a/weboob/applications/radioob/radioob.py +++ b/weboob/applications/radioob/radioob.py @@ -22,6 +22,7 @@ import os import re from shutil import which +import subprocess import requests @@ -234,7 +235,7 @@ def audio_to_file(_audio): else: return 1 - os.spawnlp(os.P_WAIT, args[0], *args) + subprocess.call(args) def complete_play(self, text, line, *ignored): args = line.split(' ') diff --git a/weboob/applications/videoob/videoob.py b/weboob/applications/videoob/videoob.py index 73d64fdac6947b333865fa9f378d445a335bbe32..b8800430fb8f24a71b9acc5c40ff60ce7d8e73e3 100644 --- a/weboob/applications/videoob/videoob.py +++ b/weboob/applications/videoob/videoob.py @@ -22,6 +22,7 @@ from io import BytesIO import os from shutil import which +import subprocess import requests @@ -128,7 +129,7 @@ def check_exec(executable): return 1 self.logger.debug(' '.join(args)) - os.spawnlp(os.P_WAIT, args[0], *args) + subprocess.call(args) def read_url(self, url): r = requests.get(url, stream=True) diff --git a/weboob/tools/application/media_player.py b/weboob/tools/application/media_player.py index 45729003705a2a0530c188e352dd5126b2a0460a..3b39ab5fcbd0d7f7038c8d7a02d4a5c141dd5df0 100644 --- a/weboob/tools/application/media_player.py +++ b/weboob/tools/application/media_player.py @@ -21,8 +21,9 @@ from __future__ import print_function from contextlib import closing -import os from subprocess import PIPE, Popen +import subprocess +import shlex from shutil import which import requests @@ -102,13 +103,11 @@ def _play_default(self, media, player_name, args=None): self._play_proxy(media, player_name, args) return None - args = player_name.split(' ') - - player_name = args[0] + args = shlex.split(player_name) args.append(media.url) print('Invoking "%s".' % (' '.join(args))) - os.spawnlp(os.P_WAIT, player_name, *args) + subprocess.call(args) def _play_proxy(self, media, player_name, args): """ @@ -175,11 +174,11 @@ def _play_rtmp(self, media, player_name, args): assert args is not None - player_name = player_name.split(' ') - args = args.split(' ') + player_name = shlex.split(player_name) + args = shlex.split(args) print(':: Streaming from %s' % media_url) print(':: to %s %s' % (player_name, args)) print(':: %s' % rtmp) - p1 = Popen(rtmp.split(), stdout=PIPE) + p1 = Popen(shlex.split(rtmp), stdout=PIPE) Popen(player_name + args, stdin=p1.stdout, stderr=PIPE)