Commit 53915bf6 authored by Laurent Bachelier's avatar Laurent Bachelier 🐧

Better way of testing the start of a string

parent d248196b
......@@ -115,11 +115,11 @@ class Videoob(ReplApplication):
ext = 'avi'
dest = '%s.%s' % (video.id, ext)
if video.url.find('rtmp') == 0:
if video.url.startswith('rtmp'):
if not check_exec('rtmpdump'):
return 1
args = ('rtmpdump', '-r', video.url, '-o', dest)
elif video.url.find('mms') == 0:
elif video.url.startswith('mms'):
if not check_exec('mimms'):
return 1
args = ('mimms', video.url, dest)
......
......@@ -82,7 +82,7 @@ class MediaPlayer(object):
player_name = self.guess_player_name()
if player_name is None:
raise MediaPlayerNotFound()
if media.url.find('rtmp') == 0:
if media.url.startswith('rtmp'):
self._play_rtmp(media, player_name)
else:
self._play_default(media, player_name)
......
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