Commit 96dd6c38 authored by Romain Bignon's avatar Romain Bignon

display a warning when no URL is available on media

parent 369341e7
......@@ -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)
......@@ -143,10 +147,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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment