From 90f501e1d22f26a84e9fbd0f08b962a5c495f7af Mon Sep 17 00:00:00 2001 From: Christopher Rosell Date: Wed, 19 Oct 2011 22:42:32 +0200 Subject: livestreamer.plugins.justintv: Behave more like flash player. --- src/livestreamer/plugins/justintv.py | 7 ++++--- 1 file 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() -- cgit v1.2.3