예제 #1
0
    def _get_streams(self):
        self.url = http.resolve_url(self.url)
        match = _url_re.match(self.url)
        parsed = urlparse(self.url)
        if parsed.fragment:
            channel_id = parsed.fragment
        elif parsed.path[:3] == '/v/':
            channel_id = parsed.path.split('/')[-1]
        else:
            channel_id = match.group("channel")

        if not channel_id:
            return

        channel_id = channel_id.lower().replace("/", "_")
        res = http.get(API_URL.format(channel_id))
        info = http.json(res, schema=_schema)

        if not info["success"]:
            return

        if info.get("isLive"):
            name = "live"
        else:
            name = "vod"

        stream = HTTPStream(self.session, info["payload"])
        # Wrap the stream in a FLVPlaylist to verify the FLV tags
        stream = FLVPlaylist(self.session, [stream])

        return {name: stream}
예제 #2
0
    def _get_streams(self):
        self.url = http.resolve_url(self.url)
        match = _url_re.match(self.url)
        parsed = urlparse(self.url)
        if parsed.fragment:
            channel_id = parsed.fragment
        elif parsed.path[:3] == '/v/':
            channel_id = parsed.path.split('/')[-1]
        else:
            channel_id = match.group("channel")

        if not channel_id:
            return

        channel_id = channel_id.lower().replace("/", "_")
        res = http.get(API_URL.format(channel_id))
        info = http.json(res, schema=_schema)

        if not info["success"]:
            return

        if info.get("isLive"):
            name = "live"
        else:
            name = "vod"

        stream = HTTPStream(self.session, info["payload"])
        # Wrap the stream in a FLVPlaylist to verify the FLV tags
        stream = FLVPlaylist(self.session, [stream])

        return {name: stream}
예제 #3
0
    def _get_stream_upload(self):
        video = urlparse(self.url).path

        if http.resolve_url(prepend_www(self.url)) == 'http://www.filmon.us/channels':
            raise PluginError(video + " don't exist")

        playpath = "mp4:resources" + video + '/v_3.mp4'

        rtmp = RTMP_UPLOAD_URL
        parsed = urlparse(rtmp)
        app = parsed.path[1:]

        return RTMPStream(self.session, {
            "rtmp": rtmp,
            "pageUrl": self.url,
            "swfUrl": SWF_UPLOAD_URL,
            "playpath": playpath,
            "app": app,
            "live": True
        })
예제 #4
0
    def _get_stream_upload(self):
        video = urlparse(self.url).path

        if http.resolve_url(prepend_www(
                self.url)) == 'http://www.filmon.us/channels':
            raise PluginError(video + " don't exist")

        playpath = "mp4:resources" + video + '/v_3.mp4'

        rtmp = RTMP_UPLOAD_URL
        parsed = urlparse(rtmp)
        app = parsed.path[1:]

        return RTMPStream(
            self.session, {
                "rtmp": rtmp,
                "pageUrl": self.url,
                "swfUrl": SWF_UPLOAD_URL,
                "playpath": playpath,
                "app": app,
                "live": True
            })