def getStreamUrl(self, id, pin): params = {"cid": id} if self.channels[id].is_protected: params["protect_code"] = self.protect_code if self.aTime: params["uts"] = (syncTime() + secTd(self.aTime)).strftime("%s") root = self.getData(self.site + "/get_url_tv?" + urllib.urlencode(params), "stream url") return root.findtext("url").encode("utf-8")
def getStreamUrl(self, id, pin): params = {"cid": id} if self.channels[id].is_protected: params["protect_code"] = self.protect_code if self.aTime: params["uts"] = (syncTime() + secTd(self.aTime)).strftime("%s") root = self.getData( self.site + "/get_url_tv?" + urllib.urlencode(params), "stream url") return root.findtext("url").encode("utf-8")
def getGmtEpg(self, cid): t = syncTime() + secTd(self.aTime) print self.channels[cid].lepg.has_key(t.strftime("%y%m%d")) lepg = self.channels[cid].lepg[t.strftime("%y%m%d")] self.trace("get gmt epg") print t for x in lepg: print x.tend if x.tend > t: self.channels[cid].aepg = x return
def getGmtEpg(self, id): params = {"m" : "channels", "act" : "get_stream_url", "cid" : id, "gmt": (syncTime() + secTd(self.aTime)).strftime("%s"), "just_info" : 1 } root = self.getData("/?"+urllib.urlencode(params), "get GmtEpg of stream %s" % id) prog = unescapeEntities(root.attrib.get("programm")).encode("utf-8") tstart = datetime.datetime.fromtimestamp( int(root.attrib.get("start").encode("utf-8")) ) #unix tend = datetime.datetime.fromtimestamp( int(root.attrib.get("next").encode("utf-8")) ) self.channels[id].aepg = EpgEntry(prog, tstart, tend)
def getGmtEpg(self, id): params = { "m": "channels", "act": "get_stream_url", "cid": id, "gmt": (syncTime() + secTd(self.aTime)).strftime("%s"), "just_info": 1 } root = self.getData("/?" + urllib.urlencode(params), "get GmtEpg of stream %s" % id) prog = unescapeEntities(root.attrib.get("programm")).encode("utf-8") tstart = datetime.datetime.fromtimestamp( int(root.attrib.get("start").encode("utf-8"))) #unix tend = datetime.datetime.fromtimestamp( int(root.attrib.get("next").encode("utf-8"))) self.channels[id].aepg = EpgEntry(prog, tstart, tend)
def getStreamUrl(self, cid, pin): params = {"m" : "channels", "act" : "get_stream_url", "cid" : cid} if self.aTime: params["gmt"] = (syncTime() + secTd(self.aTime)).strftime("%s") params["protect_code"] = pin root = self.getData("/?"+urllib.urlencode(params), "URL of stream %s" % cid) if self.aTime: prog = unescapeEntities(root.attrib.get("programm")) if prog: prog = prog.encode("utf-8") tstart = datetime.datetime.fromtimestamp( int(root.attrib.get("start").encode("utf-8")) ) #unix tend = datetime.datetime.fromtimestamp( int(root.attrib.get("next").encode("utf-8")) ) self.channels[cid].aepg = EpgEntry(prog, tstart, tend) url = root.attrib.get("url").encode("utf-8").split(' ')[0].replace('http/ts://', 'http://') if url == "protected": return 0 return url
def getStreamUrl(self, cid, pin): params = {"m": "channels", "act": "get_stream_url", "cid": cid} if self.aTime: params["gmt"] = (syncTime() + secTd(self.aTime)).strftime("%s") params["protect_code"] = pin root = self.getData("/?" + urllib.urlencode(params), "URL of stream %s" % cid) if self.aTime: prog = unescapeEntities(root.attrib.get("programm")) if prog: prog = prog.encode("utf-8") tstart = datetime.datetime.fromtimestamp( int(root.attrib.get("start").encode("utf-8"))) #unix tend = datetime.datetime.fromtimestamp( int(root.attrib.get("next").encode("utf-8"))) self.channels[cid].aepg = EpgEntry(prog, tstart, tend) url = root.attrib.get("url").encode("utf-8").split(' ')[0].replace( 'http/ts://', 'http://') if url == "protected": return 0 return url