From d9e174d4c1ab203334e816ad7f336a7b420b59fa Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Thu, 4 Aug 2011 09:24:38 +0200 Subject: [PATCH] display a warning when no URL is available on media --- weboob/applications/videoob/videoob.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/weboob/applications/videoob/videoob.py b/weboob/applications/videoob/videoob.py index 67a6cb5d..935214ae 100644 --- a/weboob/applications/videoob/videoob.py +++ b/weboob/applications/videoob/videoob.py @@ -96,6 +96,10 @@ class Videoob(ReplApplication): print >>sys.stderr, 'Video not found: %s' % _id return 3 + if not video.url: + print >>sys.stderr, 'Error: the direct URL is not available.' + return 4 + def check_exec(executable): with open('/dev/null', 'w') as devnull: process = subprocess.Popen(['which', executable], stdout=devnull) @@ -145,10 +149,13 @@ class Videoob(ReplApplication): if not video: print >>sys.stderr, 'Video not found: %s' % _id return 3 + if not video.url: + print >>sys.stderr, 'Error: the direct URL is not available.' + return 4 try: player_name = self.config.get('media_player') if not player_name: - self.logger.debug(u'You can set the media_player key to the player you prefer in the videoob ' + self.logger.info(u'You can set the media_player key to the player you prefer in the videoob ' 'configuration file.') self.player.play(video, player_name=player_name) except (InvalidMediaPlayer, MediaPlayerNotFound), e: