Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #58 from athoik/master

Add plugin fo freedocast.com
  • Loading branch information...
commit 58ace27e5b52634f5f082587fff47b0810686904 2 parents fd134b5 + d7d256f
@chrippa authored
Showing with 47 additions and 0 deletions.
  1. +47 −0 src/livestreamer/plugins/freedocast.py
View
47 src/livestreamer/plugins/freedocast.py
@@ -0,0 +1,47 @@
+from livestreamer.stream import RTMPStream
+from livestreamer.plugins import Plugin, PluginError, NoStreamsError
+from livestreamer.utils import urlget
+
+import re
+
+class Freedocast(Plugin):
+ SWFURL = "http://cdn.freedocast.com/player-octo/yume/v5/infinite-hd-player-FREEDOCAST.SWF"
+ PlayerURL = "http://www.freedocast.com/forms/watchstream.aspx?sc={0}"
+
+ @classmethod
+ def can_handle_url(self, url):
+ return "freedocast.com" in url
+
+ def _get_streams(self):
+ self.logger.debug("Fetching stream info")
+ res = urlget(self.url)
+
+ match = re.search("\"User_channelid\".+?value=\"(.+?)\"", res.text)
+ if not match:
+ raise NoStreamsError(self.url)
+
+ headers = {
+ "Referer": self.url
+ }
+
+ res = urlget(self.PlayerURL.format(match.group(1)), headers=headers)
+
+ match = re.search("stream:\s+'(rtmp://.+?)'", res.text)
+ if not match:
+ raise NoStreamsError(self.url)
+
+ rtmp = match.group(1)
+
+ streams = {}
+
+ streams["live"] = RTMPStream(self.session, {
+ "rtmp": rtmp,
+ "pageUrl": self.url,
+ "swfVfy": self.SWFURL,
+ "live": True
+ })
+
+ return streams
+
+
+__plugin__ = Freedocast
Please sign in to comment.
Something went wrong with that request. Please try again.