From 5ff656ef3e5ccc7357c4d4e6136be2e15e61281b Mon Sep 17 00:00:00 2001 From: Christopher Rosell Date: Thu, 13 Oct 2011 20:47:51 +0200 Subject: Add livestreamer.compat for 2.6 and 2.7 support. --- src/livestreamer/plugins/justintv.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/livestreamer/plugins/justintv.py') diff --git a/src/livestreamer/plugins/justintv.py b/src/livestreamer/plugins/justintv.py index 6607ae4..04ed74d 100644 --- a/src/livestreamer/plugins/justintv.py +++ b/src/livestreamer/plugins/justintv.py @@ -2,9 +2,9 @@ from livestreamer.plugins import Plugin, register_plugin from livestreamer.utils import CommandLine +from livestreamer.compat import urllib, str -import urllib.request, urllib.error, urllib.parse -import xml.dom.minidom, re +import xml.dom.minidom, re, sys class JustinTV(object): StreamInfoURL = "http://usher.justin.tv/find/%s.xml?type=any" @@ -14,7 +14,7 @@ class JustinTV(object): return ("justin.tv" in url) or ("twitch.tv" in url) def get_channel_name(self, url): - fd = urllib.request.urlopen(url) + fd = urllib.urlopen(url) data = fd.read() fd.close() @@ -42,7 +42,7 @@ class JustinTV(object): if not channelname: return False - fd = urllib.request.urlopen(self.StreamInfoURL % channelname) + fd = urllib.urlopen(self.StreamInfoURL % channelname) data = fd.read() fd.close() -- cgit v1.2.3