diff options
author | Christopher Rosell <chrippa@tanuki.se> | 2012-07-27 19:58:17 +0200 |
---|---|---|
committer | Christopher Rosell <chrippa@tanuki.se> | 2012-07-27 19:58:17 +0200 |
commit | 9485db4abf636e04b5f0732dfc4a99cee74a6361 (patch) | |
tree | ed6cdb5f3fe14a9c1b44687bc5d8a56ba3d72a55 /src/livestreamer | |
parent | 0c00231fae0595e841e3b54c4b793c629b1cace4 (diff) |
livestreamer.plugins.ownedtv: Add SWF verification.
Diffstat (limited to 'src/livestreamer')
-rw-r--r-- | src/livestreamer/plugins/ownedtv.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/livestreamer/plugins/ownedtv.py b/src/livestreamer/plugins/ownedtv.py index d312efd..47ab2f3 100644 --- a/src/livestreamer/plugins/ownedtv.py +++ b/src/livestreamer/plugins/ownedtv.py @@ -3,7 +3,7 @@ from livestreamer.compat import urllib from livestreamer.plugins import Plugin, PluginError, NoStreamsError, register_plugin from livestreamer.stream import RTMPStream -from livestreamer.utils import urlget +from livestreamer.utils import urlget, swfverify import xml.dom.minidom, re @@ -24,6 +24,7 @@ urlopener = urllib.build_opener(RelativeRedirectHandler) class OwnedTV(Plugin): ConfigURL = "http://www.own3d.tv/livecfg/{0}" + SWFURL = "http://static.ec.own3d.tv/player/Own3dPlayerV2_94.swf" CDN = { "cdn1": "rtmp://fml.2010.edgecastcdn.net/202010", "cdn2": "rtmp://owned.fc.llnwd.net:1935/owned", @@ -66,6 +67,8 @@ class OwnedTV(Plugin): channels = dom.getElementsByTagName("channels")[0] clip = channels.getElementsByTagName("clip")[0] + swfhash, swfsize = swfverify(self.SWFURL) + for item in clip.getElementsByTagName("item"): base = item.getAttribute("base") if not base: @@ -82,7 +85,10 @@ class OwnedTV(Plugin): if not name in streams: streams[name] = RTMPStream({ "rtmp": ("{0}/{1}").format(base, playpath), - "live": True + "live": True, + "swfhash": swfhash, + "swfsize": swfsize, + "pageUrl": self.url }) return streams |