aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Christopher Rosell <chrippa@tanuki.se>2011-10-19 22:42:32 +0200
committerGravatar Christopher Rosell <chrippa@tanuki.se>2011-10-19 22:42:32 +0200
commit90f501e1d22f26a84e9fbd0f08b962a5c495f7af (patch)
tree46380da864fd14f5ba90c5c968e141f8fa6d5d8c
parent5ff656ef3e5ccc7357c4d4e6136be2e15e61281b (diff)
livestreamer.plugins.justintv: Behave more like flash player.
-rw-r--r--src/livestreamer/plugins/justintv.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/livestreamer/plugins/justintv.py b/src/livestreamer/plugins/justintv.py
index 04ed74d..e9631a1 100644
--- a/src/livestreamer/plugins/justintv.py
+++ b/src/livestreamer/plugins/justintv.py
@@ -4,10 +4,10 @@ from livestreamer.plugins import Plugin, register_plugin
from livestreamer.utils import CommandLine
from livestreamer.compat import urllib, str
-import xml.dom.minidom, re, sys
+import xml.dom.minidom, re, sys, random
class JustinTV(object):
- StreamInfoURL = "http://usher.justin.tv/find/%s.xml?type=any"
+ StreamInfoURL = "http://usher.justin.tv/find/{0}.xml?type=any&p={1}"
SWFURL = "http://www.justin.tv/widgets/live_embed_player.swf"
def can_handle_url(self, url):
@@ -37,12 +37,13 @@ class JustinTV(object):
else:
return tag
+ randomp = int(random.random() * 999999)
channelname = self.get_channel_name(url)
if not channelname:
return False
- fd = urllib.urlopen(self.StreamInfoURL % channelname)
+ fd = urllib.urlopen(self.StreamInfoURL.format(channelname, randomp))
data = fd.read()
fd.close()