From 8671361ede63111b6ee222c314ba0df3600d2b85 Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Fri, 8 Apr 2011 19:30:37 +0200 Subject: [PATCH] fix mediaplayer --- weboob/tools/application/media_player.py | 30 +++++++++++++----------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/weboob/tools/application/media_player.py b/weboob/tools/application/media_player.py index 9f06f129..3cbcda88 100644 --- a/weboob/tools/application/media_player.py +++ b/weboob/tools/application/media_player.py @@ -1,21 +1,19 @@ # -*- coding: utf-8 -*- -# Copyright(C) 2010-2011 Christophe Benz, Romain Bignon, John Obbele +# Copyright(C) 2010 Christophe Benz, Romain Bignon, John Obbele # -# This file is part of weboob. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. # -# weboob is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# weboob is distributed in the hope that it will be useful, +# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU Affero General Public License -# along with weboob. If not, see . +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import os @@ -28,9 +26,9 @@ __all__ = ['InvalidMediaPlayer', 'MediaPlayer', 'MediaPlayerNotFound'] PLAYERS = ( + ('mplayer', '-'), ('parole', 'fd://0'), ('totem', 'fd://0'), - ('mplayer', '-really-quiet -'), ('vlc', '-'), ('xine', 'stdin:/'), ) @@ -109,7 +107,10 @@ class MediaPlayer(object): media_url = media.url try: player_url = media.swf_player - rtmp = 'rtmpdump -r %s --swfVfy %s' % (media_url, player_url) + if media.swf_player: + rtmp = 'rtmpdump -r %s --swfVfy %s' % (media_url, player_url) + else: + rtmp = 'rtmpdump -r %s' % media_url except AttributeError: self.logger.warning('Your media object does not have a "swf_player" attribute. SWF verification will be ' 'disabled and may prevent correct media playback.') @@ -125,6 +126,7 @@ class MediaPlayer(object): print ':: Streaming from %s' % media_url print ':: to %s %s' % (player_name, args) + print ':: %s' % rtmp p1 = Popen(rtmp.split(), stdout=PIPE) Popen([player_name, args], stdin=p1.stdout, stderr=PIPE)