def drawVipracinginfo(page): jsonChannels = Vipracinginfo.getChannels(page) mode = 107 for item in jsonChannels: title = item["title"] link = item["link"] add_dir(title, link, mode, icon, "vipracinginfo", link)
def drawStreamingsport365(): mode = 2 jsonChannels = StreamingSports365.getChannels() for item in jsonChannels: title = item["title"] link = item["link"] add_dir(title, link, mode, icon, "streamingsports365", link)
def drawCNNNews(url): x = CNN.getChannels(url) if str(url) == '0': level = 4 for new in x: img = icon if new.has_key("thumbnail"): img = new["thumbnail"] add_dir(new["title"], new["link"], level, img, "editioncnn", new["link"]) else: body = x[0]["title"] logger.debug("body is: " + body) #clean bad html body = body.replace( '<h4 class="video__end-slate__tertiary-title">MUST WATCH</h4>', "") body = body.replace( '<div class="video__end-slate__engage__more"><a href="/videos" class="video__end-slate__replay-text">More Videos ...</a></div>', "") body = body.replace( '<h4 class="video__end-slate__tertiary-title">MUST WATCH</h4>', "") body = body.replace('<h3 class="cd__headline-title">JUST WATCHED</h3>', "") body = body.replace(".", ". \n") logger.debug("drawing new...") drawNew(textContent=(body))
def drawSplive(page): mode = 4 jsonChannels = Spliveappcom.getChannels(page) image = icon for item in jsonChannels: try: logger.debug("trying splive item...") #title = urllib.unquote_plus(item["title"].decode('iso-8859-1', 'ignore')) title = item["title"] link = item["link"] referer = "splive" if item.has_key("permaLink"): mode = 111 if item.has_key("referer"): referer = item["referer"] logger.info("referer is: " + referer) if item.has_key("thumbnail"): image = item["thumbnail"] logger.info("detected img: " + image) else: image = icon add_dir(title, link, mode, image, referer, link) except: logger.error("Something goes wrong with SPLIVEAPP drawer") pass
def drawSportstream365(page): mode = 110 jsonChannels = Sportstream365com.getChannels(page) for item in jsonChannels: title = item["title"] link = item["link"] image = icon add_dir(title, link, mode, image, "sportstream365com", link)
def drawZonasportsme(page): mode = 109 jsonChannels = Zonasportsme.getChannels(page) for item in jsonChannels: title = item["title"] link = item["link"] image = icon add_dir(title, link, mode, image, "zonasportsme", link)
def drawAcesoplistingin(page): mode = 2 jsonChannels = Acesoplistingin.getChannels(page) for item in jsonChannels: title = item["title"] link = item["link"] image = icon add_dir(title, link, mode, image, "acesoplistingin", link)
def drawXspf(html,icon=''): lists = common.parseDOM(html,"track") #rusian acelive format if len(lists)>0: for item in lists: name = common.parseDOM(item,"title")[0].encode("utf-8") value = common.parseDOM(item,"location")[0].encode("utf-8") logger.info("Added: "+name+", url: "+value) add_dir(name, value, 2, icon,'', 0)
def drawHdfullhdeu(page): jsonChannels = Hdfullhdeu.getChannels(page) mode = 4 for item in jsonChannels: title = item["title"] link = item["link"] if item.has_key("permaLink"): mode = 2 add_dir(title, link, mode, icon, "hdfullhdeu", link)
def drawHdfulltv(page): mode = 4 #continue browsing jsonChannels = HdfullTv.getChannels(page) for itemFirst in jsonChannels: title = "" if itemFirst.has_key("permalink"): if itemFirst.has_key("show"): #serie link = "https://hdfull.me/serie/" + itemFirst[ "permalink"] + "/temporada-" + itemFirst[ "season"] + "/episodio-" + itemFirst["episode"] title = itemFirst["show"]["title"] if type(title) == type(dict()): if title.has_key("es"): title = title["es"] else: title = "" if len(title) == 0 and itemFirst["title"].has_key("en"): title = itemFirst["title"]["en"] #put the season and the chapter chapter = int(itemFirst["episode"]) if chapter < 10: chapterString = "0" + str(chapter) else: chapterString = str(chapter) title = title + " " + itemFirst["season"] + "x" + chapterString else: if (itemFirst["permalink"].find("http://") > -1): link = itemFirst["permalink"] elif itemFirst["permalink"].find("http") > -1: link = itemFirst["permalink"] else: link = "https://hdfull.me/" + itemFirst["permalink"] title = itemFirst["title"] try: if type(title) == type(dict()): if title.has_key("es"): title = title["es"] else: title = "" if len(title) == 0 and itemFirst["title"].has_key( "en"): title = itemFirst["title"]["en"] except: logger.error("title is not dic, fails!!" + str(title)) pass if itemFirst.has_key("thumbnail"): image = itemFirst["thumbnail"] if image.find("http://") < 0: image = "https://hdfull.me/tthumb/130x190/" + image else: image = icon if itemFirst.has_key("finalLink"): mode = 100 #open link from provider title = itemFirst["title"] link = itemFirst["link"] image = "" add_dir(title, link, mode, image, "hdfulltv", link)
def drawZonaAppCom(): channels = ZonaAppCom.getChannelsJSON() logger.debug("items obtained: " + str(len(channels))) for channel in channels: image = '' level = 116 if channel.has_key('thumbnail'): image = channel["thumbnail"] add_dir(channel["title"], channel["link"], level, image, "zonaappcom", channel["link"])
def drawPastebinCom(): param = urllib.quote_plus( str(XBMCUtils.getSettingFromContext(sys.argv[1], 'pastebin_param'))) logger.debug("extracted param to be searched: " + param) channels = Pastebin.searchLists(param=param) logger.debug("items obtained: " + str(len(channels))) level = 1 for channel in channels: add_dir(channel["title"], channel["link"], level, '', "pastebincom", channel["link"])
def drawYoutvgratis(url): channels = Youtvgratis.getChannels(url) logger.debug("items obtained: " + str(len(channels))) level = 119 # stream for channel in channels: img = '' if channel.has_key("thumbnail"): img = channel["thumbnail"] add_dir(channel["title"], channel["link"], level, img, "youtvgratis", channel["link"])
def drawCinestrenostv(page): jsonChannels = Cineestrenostv.getChannels(page) for item in jsonChannels: title = item["title"] link = item["link"] mode = 102 #next step returns a final link if item.has_key("thumbnail"): image = item["thumbnail"] else: image = icon add_dir(title, link, mode, image, "cineestrenos", link)
def drawSports4u(page): jsonChannels = Sports4u.getChannels(page) for item in jsonChannels: title = item["title"] link = item["link"] mode = 106 #next step returns a final link if item.has_key("thumbnail"): image = item["thumbnail"] else: image = icon add_dir(title, link, mode, image, "sports4u", link)
def displayClan(url, page): finalUrls = Clan.getChannels(page) for element in finalUrls: code = 4 if element.has_key("finalLink"): code = 125 image = icon if element.has_key("thumbnail"): image = element["thumbnail"] add_dir(element["title"], element["link"], code, image, "clan", element["link"])
def displayRTVE(url, page): finalUrls = RTVEAlaCarta.getChannels(page) for element in finalUrls: code = 4 if element.has_key("finalLink"): code = 125 image = icon if element.has_key("thumbnail"): image = element["thumbnail"] add_dir(element["title"], element["link"], code, image, "rtvealacarta", element["link"])
def drawPepecine(url, page): finalUrls = Pepecine.getChannels(page) for element in finalUrls: code = 4 if element.has_key("finalLink"): code = 2 image = icon if element.has_key("thumbnail"): image = element["thumbnail"] add_dir(element["title"], element["link"], code, image, "pepecine", element["link"])
def drawLive9(page): jsonChannels = Live9net.getChannels(page) for item in jsonChannels: title = item["title"] link = item["link"] mode = 105 #next step returns a final link if item.has_key("thumbnail"): image = item["thumbnail"] else: image = icon add_dir(title, link, mode, image, "live9", link)
def drawPeliculasBiz(url, page): finalUrls = Peliculasbiz.getChannels(page) for element in finalUrls: code = 4 if element.has_key("finalLink"): code = 123 image = icon if element.has_key("thumbnail"): image = element["thumbnail"] add_dir(element["title"], element["link"], code, image, "peliculasbiz", element["link"])
def drawRedeneobuxCom(url): channels = RedeneobuxCom.getChannels(url) logger.debug("items obtained: " + str(len(channels))) for channel in channels: level = 4 if channel.has_key("finalLink"): level = 2 #m3u8 list img = '' if channel.has_key("thumbnail"): img = channel["thumbnail"] add_dir(channel["title"], channel["link"], level, img, "redeneobuxcom", channel["link"])
def displayAntena3Teletext(url, page): logger.debug("displaying teletext for Antena3Text provider") imgPath = 'http://www.antena3.com/teletexto/100/100_0001.png' #first x = Antena3.getChannels(page) for element in x: if element.has_key("thumbnail"): #displayed thumbnail imgPath = element["thumbnail"] else: #continue add_dir(element["title"], element["link"], 4, element["link"], "teletext", element["link"]) #finally show img (before render, xbmc will wait until some event happens) displayImg(imgPath)
def drawReutersNews(url): #from rss page x = Reuters.getChannels(url) if str(url) == '0': level = 4 for new in x: img = icon if new.has_key("thumbnail"): img = new["thumbnail"] add_dir(new["title"], new["link"], level, img, "reuters", 1) else: body = x[0]["title"] drawNew(textContent=(body))
def drawYomviEs(page): mode = 120 jsonChannels = Yomvies.getChannels(page) for item in jsonChannels: title = item["title"] link = item["link"] if item.has_key("thumbnail"): image = item["thumbnail"] logger.info("detected img: " + image) else: image = icon add_dir(title, link, mode, image, "yomvies", link)
def drawTuneIn(url): channels = TuneIn.getChannels(url) logger.debug("items obtained: " + str(len(channels))) for channel in channels: level = 4 if channel.has_key("finalLink"): level = 118 # stream img = '' if channel.has_key("thumbnail"): img = channel["thumbnail"] add_dir(channel["title"], channel["link"], level, img, "tunein", channel["link"])
def drawBruteChannels(html,icon=''): bruteChannels = html.split("#EXTINF") for item in bruteChannels: item = item[item.find(",") + 1:] name = item[:item.find("\n")] value = item[item.find("\n") + 1:] value = value[:value.find("\n")] # print "detected channel: "+name+" with url: "+value if name != "" and value != "": ##check for empty channels, we don't want it in our list add_dir(name, value, 2, icon, '', name) else: logger.debug("Discarted brute: " + name + ", " + value)
def drawYoutube(url='0'): #BROWSES ALL PROVIDERS (it has been re-sorted) #static content channels = Youtube.getChannels(url) logger.debug("items obtained: " + str(len(channels))) for channel in channels: image = '' level = 4 if channel.has_key('finalLink'): level = 115 if channel.has_key('thumbnail'): image = channel["thumbnail"] add_dir(channel["title"], channel["page"], level, image, "youtube", channel["page"])
def drawMejorTorrent(page): jsonChannels = MejorTorrent.getChannels(page) for item in jsonChannels: mode = 4 title = item["title"] link = item["link"] if 'secciones.php' in link and '&p=' not in link: mode = 127 if item.has_key("thumbnail"): image = item["thumbnail"] logger.info("detected img: " + image) else: image = icon add_dir(title, link, mode, image, "mejortorrent", link)
def drawTuMejorTorrent(page): jsonChannels = TuMejorTorrent.getChannels(page) for item in jsonChannels: mode = 4 title = item["title"] link = item["link"] if item.has_key("finalLink"): mode = 126 if item.has_key("thumbnail"): image = item["thumbnail"] logger.info("detected img: " + image) else: image = icon add_dir(title, link, mode, image, "tumejortorrent", link)
def drawFilmon(page): jsonChannels = Filmoncom.getChannelsJSON() for itemFirst in jsonChannels: if page == "0": add_dir(itemFirst["title"], "http://www.filmon.com/tv/" + itemFirst["alias"], 4, icon, "filmoncom", itemFirst["title"]) elif (page == itemFirst["title"]) and itemFirst.has_key("channels"): for item in itemFirst["channels"]: add_dir(item["title"], "http://www.filmon.com/tv/" + item["alias"], 5, item["logo"], "filmoncom", item["title"]) else: logger.info("no channel: " + page)