Better way of testing the start of a string
This commit is contained in:
parent
d248196bb1
commit
53915bf6b5
2 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue