diff options
author | Christopher Rosell <chrippa@tanuki.se> | 2012-04-21 20:35:43 +0200 |
---|---|---|
committer | Christopher Rosell <chrippa@tanuki.se> | 2012-04-21 20:35:43 +0200 |
commit | e3b3bdf86e9e9921ce6c76e8dd587dbe0b41f33e (patch) | |
tree | 6f9ae0c3b56199b05c477baa82bb5218df3b5ba4 /src/livestreamer/plugins/justintv.py | |
parent | 0eb8969b0667fb641356a5734126b645aa211c0f (diff) |
Make get_streams always return a dict.
Diffstat (limited to 'src/livestreamer/plugins/justintv.py')
-rw-r--r-- | src/livestreamer/plugins/justintv.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/livestreamer/plugins/justintv.py b/src/livestreamer/plugins/justintv.py index 16c522c..f8e4e0b 100644 --- a/src/livestreamer/plugins/justintv.py +++ b/src/livestreamer/plugins/justintv.py @@ -69,20 +69,15 @@ class JustinTV(Plugin): res.append(node.data) return "".join(res) - def _get_streams(self): + def _get_streaminfo(self, channelname): def clean_tag(tag): if tag[0] == "_": return tag[1:] else: return tag - randomp = int(random.random() * 999999) - channelname = self._get_channel_name(self.url) - - if not channelname: - return False - metadata = self._get_metadata(channelname) + randomp = int(random.random() * 999999) if "chansub_guid" in metadata: fd = urllib.urlopen(self.StreamInfoURLSub.format(channelname, randomp, metadata["chansub_guid"])) @@ -123,4 +118,12 @@ class JustinTV(Plugin): return streams + def _get_streams(self): + channelname = self._get_channel_name(self.url) + + if not channelname: + return {} + + return self._get_streaminfo(channelname) + register_plugin("justintv", JustinTV) |