Skip to content

Commit

Permalink
Merge pull request #352 from papplampe/develop
Browse files Browse the repository at this point in the history
Added picarto plugin
  • Loading branch information
chrippa committed Apr 15, 2014
2 parents e96ea98 + e0af411 commit 664ab49
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/livestreamer/plugins/picarto.py
@@ -0,0 +1,30 @@
from livestreamer.exceptions import PluginError, NoStreamsError
from livestreamer.plugin import Plugin
from livestreamer.stream import RTMPStream
from livestreamer.compat import urlparse
from livestreamer.utils import parse_qsd

class Picarto(Plugin):

@classmethod
def can_handle_url(self, url):
return "picarto.tv" in url

def _get_streams(self):
params = parse_qsd(urlparse(self.url).query)
if not 'watch' in params:
raise NoStreamsError(self.url)
channel = params['watch']

if not RTMPStream.is_usable(self.session):
raise PluginError("rtmpdump is not usable but required by Picarto plugin")

streams = {}
streams["live"] = RTMPStream(self.session, {
"rtmp": "rtmp://199.189.86.17/dsapp/{0}.flv".format(channel),
"pageUrl": self.url,
"live": True
})
return streams

__plugin__ = Picarto

0 comments on commit 664ab49

Please sign in to comment.