summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntti Ajanki <antti.ajanki@iki.fi>2011-07-07 19:48:57 +0300
committerAntti Ajanki <antti.ajanki@iki.fi>2011-07-07 19:48:57 +0300
commit52bf1c57acabffd5cf9e1f101c6d52cd6fffdc2c (patch)
tree3a1fc3e10f6752fa54dc57175352aee729b38290
parent5c72f6e219eadb4d4073b04960e0809836950599 (diff)
downloadvdr-plugin-webvideo-52bf1c57acabffd5cf9e1f101c6d52cd6fffdc2c.tar.gz
vdr-plugin-webvideo-52bf1c57acabffd5cf9e1f101c6d52cd6fffdc2c.tar.bz2
slightly safer way of substituting stream name
-rw-r--r--src/webvicli/webvicli/client.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/webvicli/webvicli/client.py b/src/webvicli/webvicli/client.py
index 3d63080..c15f073 100644
--- a/src/webvicli/webvicli/client.py
+++ b/src/webvicli/webvicli/client.py
@@ -487,17 +487,17 @@ class WVClient:
# Found url, now find a working media player
for player in self.streamplayers:
if '%s' not in player:
- playcmd = player + ' ' + streamurl
- else:
- try:
- # Hack for playing from fifo in VLC
- if 'vlc' in player and streamurl.startswith('file://'):
- streamurl = 'stream://' + streamurl[len('file://'):]
-
- playcmd = player % streamurl
- except TypeError:
- print 'Can\'t substitute URL in', player
- continue
+ player = player + ' %s'
+
+ try:
+ # Hack for playing from fifo in VLC
+ if 'vlc' in player and streamurl.startswith('file://'):
+ streamurl = 'stream://' + streamurl[len('file://'):]
+
+ playcmd = player.replace('%s', streamurl, 1)
+ except TypeError:
+ print 'Can\'t substitute URL in', player
+ continue
try:
print 'Trying player: ' + playcmd