diff options
author | Christopher Rosell <chrippa@tanuki.se> | 2012-03-21 13:10:02 +0100 |
---|---|---|
committer | Christopher Rosell <chrippa@tanuki.se> | 2012-03-21 13:10:02 +0100 |
commit | f175241692dfc461d773589653fd55c47508a293 (patch) | |
tree | 38e9bb2416c5631ea08038d607d46384d2c67758 /src/livestreamer/plugins/justintv.py | |
parent | 4ea8ddfd4d89ca96e81ddf07ec3c7d0abfc8de70 (diff) |
Change the way plugins are used.
Also use http as default protocol when URL is
missing protocol.
Diffstat (limited to 'src/livestreamer/plugins/justintv.py')
-rw-r--r-- | src/livestreamer/plugins/justintv.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/livestreamer/plugins/justintv.py b/src/livestreamer/plugins/justintv.py index 9db0932..233a17b 100644 --- a/src/livestreamer/plugins/justintv.py +++ b/src/livestreamer/plugins/justintv.py @@ -12,9 +12,11 @@ class JustinTV(Plugin): MetadataURL = "http://www.justin.tv/meta/{0}.xml?on_site=true" SWFURL = "http://www.justin.tv/widgets/live_embed_player.swf" + @classmethod def can_handle_url(self, url): return ("justin.tv" in url) or ("twitch.tv" in url) + @classmethod def handle_parser(self, parser): parser.add_argument("--jtv-cookie", metavar="cookie", help="JustinTV cookie to allow access to subscription channels") @@ -60,7 +62,7 @@ class JustinTV(Plugin): res.append(node.data) return "".join(res) - def get_streams(self, url): + def get_streams(self): def clean_tag(tag): if tag[0] == "_": return tag[1:] @@ -68,7 +70,7 @@ class JustinTV(Plugin): return tag randomp = int(random.random() * 999999) - channelname = self._get_channel_name(url) + channelname = self._get_channel_name(self.url) if not channelname: return False |