fd.close() stream = {} playpath = get_amf_value(data, "streamName") cdnurl = get_amf_value(data, "cdnUrl") fmsurl = get_amf_value(data, "fmsUrl") if not playpath: return False stream["playpath"] = playpath stream["rtmp"] = cdnurl or fmsurl stream["url"] = url return {"live": stream} def stream_cmdline(self, stream, filename): cmd = CommandLine("rtmpdump") cmd.arg("rtmp", ("{0}/{1}").format(stream["rtmp"], stream["playpath"])) cmd.arg("swfUrl", self.SWFURL) cmd.arg("pageUrl", stream["url"]) cmd.arg("live", True) cmd.arg("flv", filename) return cmd.format() register_plugin("ustreamtv", UStreamTV)
for node in nodes.childNodes: info = {} for child in node.childNodes: info[child.tagName] = self._get_node_text(child) stream = RTMPStream({ "rtmp": ("{0}/{1}").format(info["connect"], info["play"]), "swfUrl": self.SWFURL, "swfhash": swfhash, "swfsize": swfsize, "live": 1 }) if "token" in info: stream.params["jtv"] = info["token"] sname = clean_tag(node.tagName) streams[sname] = stream 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)
continue if base[0] == "$": ref = re.match("\${(.+)}", base).group(1) base = self.CDN[ref] for streamel in item.getElementsByTagName("stream"): name = streamel.getAttribute("label").lower().replace(" ", "_") playpath = streamel.getAttribute("name") if not name in streams: streams[name] = { "base": base, "name": name, "playpath": playpath } return streams def stream_cmdline(self, stream, filename): cmd = CommandLine("rtmpdump") cmd.arg("rtmp", ("{0}/{1}").format(stream["base"], stream["playpath"])) cmd.arg("live", True) cmd.arg("flv", filename) return cmd.format() register_plugin("own3dtv", OwnedTV)