display a warning when no URL is available on media
This commit is contained in:
parent
59f8fc9622
commit
d9e174d4c1
1 changed files with 8 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue