def check_update(params): plugintools.log("[tv.ultra.7k-0.3.0].check_update "+repr(params)) data = plugintools.read( params.get("url") ) datamovie = {} #plugintools.log("data= "+data) title = params.get("title") name_channel = parser_title(title) # name_channel = parser_title(name_channel) data_update = plugintools.find_single_match(data, '<name>'+name_channel+'(.*?)</channel>') subchannel = plugintools.find_multiple_matches(data_update, '<subchannel>(.*?)</subchannel>') datamovie["Plot"]='Módulo de actualizaciones para [B]TV Ultra 7K[/B]' plugintools.add_item(action = "", title = '[COLOR gold]Updater TV Ultra 7K[/COLOR]', url = "" , info_labels=datamovie, thumbnail = params.get("thumbnail") , fanart = params.get("fanart") , folder = False , isPlayable = False) i = 0 for entry in subchannel: plugintools.log("entry= "+entry) title = plugintools.find_single_match(entry, '<name>(.*?)</name>') url = plugintools.find_single_match(entry, '<url>([^<]+)</url>') thumbnail = plugintools.find_single_match(entry, '<thumbnail>([^<]+)</thumbnail>') version = plugintools.find_single_match(entry, '<version>([^<]+)</version>') author = plugintools.find_single_match(entry, '<author>([^<]+)</author>') size_remote = plugintools.find_single_match(entry, '<filesize>([^<]+)</filesize>') ts_remote = plugintools.find_single_match(entry, '<update>([^<]+)</update>') path = plugintools.find_single_match(entry, '<path>([^<]+)</path>') fanart = plugintools.find_single_match(entry, '<fanart>([^<]+)') datamovie["Plot"] = '[COLOR white]'+plugintools.find_single_match(entry, '<changelog>(.*?)</changelog>')+'[/COLOR]' f = open(home+path, 'r') f.seek(0,2) size_local = f.tell() size_local = str(size_local) last_modified = time.ctime(os.path.getmtime(home+path)) print 'last_modified',str(last_modified) # Última modificación del archivo print 'ts_remote',ts_remote dt = parse(last_modified) ts_local = time.mktime(dt.timetuple()) ts = parse(ts_remote) ts_remote = time.mktime(ts.timetuple()) print 'ts_local',ts_local # Última modificación del archivo local print 'ts_remote',ts_remote # Última modificación del archivo remoto if int(ts_remote) <= int(ts_local) : plugintools.log("[%s %s] No es necesario actualizar el módulo= %s " % (addonName, addonVersion, path)) else: # Hay que actualizar, así que mostramos la entrada plugintools.addShow(action = "update_file", title = '[COLOR white]'+title+'[/COLOR][COLOR lightblue][I] [' + author + '][/I][/COLOR][COLOR lightgreen][I] [' + version + '][/I][/COLOR]', url = url , info_labels=datamovie, thumbnail = thumbnail , extra = home+path , fanart = fanart , folder = False , isPlayable = False) i = i + 1 if i == 0: datamovie["Plot"]='¡Felicidades! Tu copia de [B]TV Ultra 7K[/B] tiene todos los módulos actualizados ;)[CR][CR][COLOR red]NOTA:[/COLOR] Bugs o sugerencias a [B][email protected][/B]' plugintools.addShow(action = "", title = '[COLOR white]No hay actualizaciones pendientes[/COLOR]', url = "" , info_labels=datamovie, thumbnail = 'http://www.clker.com/cliparts/U/b/3/E/T/z/ok-icon-hi.png' , fanart = params.get("fanart") , folder = False , isPlayable = False)
def ivoox_audiolibro_secc(params): plugintools.log("[%s %s] Ivoox Parser... %s " % (addonName, addonVersion, repr(params))) titulo = '[COLOR white][B]IVOOX[/B][/COLOR]' + version + '[COLOR blue][B]| AudioLibros |[/B][/COLOR]' plugintools.add_item(action="", url="", title=titulo, thumbnail=logo_AudioLibros, fanart=fanart_AudioLibros, folder=False, isPlayable=False) infolabels = {} fanart_secc = params.get("fanart") if fanart_secc == "": fanart_secc = 'http://www.elandroidelibre.com/wp-content/uploads/2012/07/ivoox-splash.jpg' thumbnail = params.get("thumbnail") if thumbnail == "": thumbnail = "https://www.cubbyusercontent.com/pl/dmrbvZOM.jpeg/_abb9cea697fa4317bed15895009bb91d" logo = params.get("thumbnail") headers = { "Host": "www.ivoox.com", "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0" } url = params.get("url") r = requests.get(url, headers=headers) data = r.content bloque_podcast = plugintools.find_single_match( data, '<div class="wrapper-modulo-lista">(.*?)<footer>') podcast = plugintools.find_multiple_matches( bloque_podcast, '<div class="flipper">(.*?)<!-- END Parche -->') #print podcast for item in podcast: title = plugintools.find_single_match( item, '<meta itemprop="name" content="(.*?)"/>').replace( """, "").replace("#", "") logo = plugintools.find_single_match(item, '<img src="(.*?)"') url = plugintools.find_single_match( item, '<meta itemprop="url" content="(.*?)"/>') mode_prog = plugintools.find_single_match( item, '<span>(.*?)</span>').strip() episfull = sc4 + mode_prog + ec4 + sc1 + " - Reproducir AudioLibro >>" + ec1 desc = plugintools.find_single_match( item, '<meta itemprop="description" content="(.*?)"/>').strip().replace( "\n", "").replace("\t", "").replace(""", "") dur = plugintools.find_single_match(item, '<p class="time">(.*?)</p>') infofull = sc + "Descripción: " + desc + " - Duración: " + dur + ec infolabels["plot"] = infofull plugintools.addShow(action="audiolibro_regex", url=url, info_labels=infolabels, title=sc3 + "[B]" + title + "[/B]" + ec3, thumbnail=logo, fanart=fanart_secc, folder=False, isPlayable=True) # Paginación ------------------------>> bloque_paginacion = plugintools.find_single_match( data, '<ul class="pagination">(.*?)</ul>') if bloque_paginacion != "": pag_actual = plugintools.find_single_match( bloque_paginacion, '<a href="#" class="disabled">\s+(.*?)\s+</a>').strip().replace( "\n", "").replace("\t", "") if int(pag_actual) > 1: pag_ant = int(pag_actual) - 1 url_prev = plugintools.find_single_match( bloque_paginacion, '<a rel="nofollow" href="([^"]+)"') plugintools.addDir(action="ivoox_audiolibro_secc", url=url_prev, title="[COLOR blue][I]" + str(pag_ant) + " « Página anterior ·" + ec5 + ' ' * 25, thumbnail=logo, fanart=fanart_secc, folder=True, isPlayable=False) pag_sig = plugintools.find_single_match( bloque_paginacion, '<a href="#" class="disabled">.*?title=".*?">\s+(.*?)\s+</a>') if pag_sig != "": url_next = plugintools.find_single_match( bloque_paginacion, '<a href="#" class="disabled">.*?href="([^"]+)"') plugintools.addDir(action="ivoox_audiolibro_secc", url=url_next, title=' ' * 25 + "[COLOR blue][I]Página siguiente » " + str(pag_sig) + "[/I][/COLOR]", thumbnail=logo, fanart=fanart_secc, folder=True, isPlayable=False)
def Secciones_Ivoox( params): #Esta funcion me vale para casi todas las secciones plugintools.log("[%s %s] Ivoox Parser... %s " % (addonName, addonVersion, repr(params))) titulo = ' ' * 21 + "[COLOR sienna][B]-IVOOX-[/B][/COLOR][COLOR red][I] " + version + "[/I][/COLOR]" infolabels = {} fanart_secc = params.get("fanart") if fanart_secc == "": fanart_secc = 'http://www.elandroidelibre.com/wp-content/uploads/2012/07/ivoox-splash.jpg' thumbnail = params.get("thumbnail") if thumbnail == "": thumbnail = "https://www.cubbyusercontent.com/pl/dmrbvZOM.jpeg/_abb9cea697fa4317bed15895009bb91d" logo_secc = params.get("thumbnail") infolabels[ "plot"] = sc5 + "· Autor del Parser: V1k1ng0 · · Autor del Regex: Aquilesserr · " + ec5 plugintools.add_item( action="", url="", title=titulo, info_labels=infolabels, thumbnail= 'https://www.cubbyusercontent.com/pl/dmrbvZOM.jpeg/_abb9cea697fa4317bed15895009bb91d', fanart= 'https://www.cubbyusercontent.com/pl/Podcast1.jpg/_e50737800d444c48bccfb877f3f90166', folder=False, isPlayable=False) plugintools.add_item( action="", url="", title="", thumbnail= 'https://www.cubbyusercontent.com/pl/LogoParser.png/_a6d13ccdcbce474eb2afb9707a01d78c', fanart= 'https://www.cubbyusercontent.com/pl/Podcast1.jpg/_e50737800d444c48bccfb877f3f90166', folder=False, isPlayable=False) headers = { "Host": "www.ivoox.com", "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0", "Referer": ref } url = params.get("url") r = requests.get(url, headers=headers) data = r.content #print data bloque_podcast = plugintools.find_single_match( data, '<div class="wrapper-modulo-lista">(.*?)<footer>') if 'ESCUCHAR RADIO' in bloque_podcast: podcast = plugintools.find_multiple_matches( bloque_podcast, '<div class="flip-container">(.*?)<span>ESCUCHAR RADIO</span>') else: podcast = plugintools.find_multiple_matches( bloque_podcast, '<div class="flip-container">(.*?)</ul>') for item in podcast: if 'ESCUCHAR RADIO' in bloque_podcast: title = plugintools.find_single_match( item, '<div class="header-modulo">\s+<a href=".*?title="([^"]+)"' ).replace(""", "").replace("#", "") #logo = params.get("thumbnail") #if logo == "" or logo.endswith("icon.png") == True: logo = plugintools.find_single_match(item, '<img src="(.*?)"') url = plugintools.find_single_match( item, '<div class="header-modulo">\s+<a href="([^"]+)"') mode_rad = plugintools.find_single_match( item, '<strong>(.*?)</strong>').strip() episfull = sc4 + mode_rad + ec4 + sc1 + " - Escuchar Emisora >>" + ec1 plugintools.add_item(action="", url="", title=sc3 + "[B]" + title + "[/B]" + ec3, thumbnail=logo, fanart=fanart_secc, folder=False, isPlayable=False) plugintools.addShow(action="ivoox_regex", url=url, title=episfull, thumbnail=logo, fanart=fanart_secc, folder=False, isPlayable=True) plugintools.add_item(action="", url=url, title="", thumbnail=logo, fanart=fanart_secc, folder=False, isPlayable=False) elif 'IR AL PROGRAMA' in bloque_podcast: title = plugintools.find_single_match( item, '<div class="header-modulo">\s+<a href=".*?title="([^"]+)"' ).replace(""", "").replace("#", "") #logo = params.get("thumbnail") #if logo == "" or logo.endswith("icon.png") == True: logo = plugintools.find_single_match(item, '<img src="(.*?)"') url = plugintools.find_single_match( item, '<div class="header-modulo">\s+<a href="([^"]+)"') mode_prog = plugintools.find_single_match( item, '<strong>(.*?)</strong>').strip() episfull = sc4 + mode_prog + ec4 + sc1 + " - Ir A Programa >>" + ec1 desc = plugintools.find_single_match( item, '<meta itemprop="description" content="(.*?)"/>').strip( ).replace("\n", "").replace("\t", "") aud = plugintools.find_single_match(item, 'Audios">(.*?)</a></li>') infofull = sc + "Descripción: " + desc + " - Audios: " + aud + ec infolabels["plot"] = infofull plugintools.add_item(action="ivoox_audiolibro_secc", url="", title=sc3 + "[B]" + title + "[/B]" + ec3, thumbnail=logo, info_labels=infolabels, fanart=fanart_secc, folder=True, isPlayable=False) if 'podcast_sc_f443.67_1.html' in params.get("url"): plugintools.add_item(action="ivoox_audiolibro_secc", url=url, info_labels=infolabels, title=episfull, thumbnail=logo, fanart=fanart_secc, folder=True, isPlayable=False) else: plugintools.add_item(action="ivoox_audiolibro_secc", url=url, info_labels=infolabels, title=episfull, thumbnail=logo, fanart=fanart_secc, folder=True, isPlayable=False) plugintools.add_item(action="", url=url, title="", thumbnail=logo, fanart=fanart_secc, folder=False, isPlayable=False) else: title = plugintools.find_single_match( item, '<div class="header-modulo">\s+<a href=".*?title="([^"]+)"' ).replace(""", "").replace("#", "") logo = params.get("thumbnail") if logo == "" or logo.endswith("icon.png") == True: logo = plugintools.find_single_match(item, '<img src="(.*?)"') url = plugintools.find_single_match( item, '<div class="header-modulo">\s+<a href="([^"]+)"') epis = plugintools.find_single_match( item, '<strong>\s+(.*?)</strong>').strip().replace( "\n", "").replace("\t", "") gen = plugintools.find_single_match( item, '<p class="time">.*?<a class="rounded-label.*?">\s+(.*?)</a>' ).strip().replace("\n", "").replace("\t", "") durac = plugintools.find_single_match(item, '<p class="time">([^<]+)<') episfull = sc4 + "Episodio en " + epis + ec4 + sc2 + " - Escuchar Podcast >>" + ec2 infofull = sc + "Género: " + gen + " - Duración: " + durac + ec url = plugintools.find_single_match( item, '<div class="header-modulo">\s+<a href="([^"]+)"') infolabels["plot"] = infofull plugintools.addShow(action="ivoox_regex", title='[COLOR white]' + title + '[/COLOR]', url=url, info_labels=infolabels, thumbnail=logo, fanart=fanart_secc, folder=False, isPlayable=True) # Paginación ------------------------>> bloque_paginacion = plugintools.find_single_match( data, '<ul class="pagination">(.*?)</ul>') if bloque_paginacion != "": pag_actual = plugintools.find_single_match( bloque_paginacion, '<a href="#" class="disabled">\s+(.*?)\s+</a>').strip().replace( "\n", "").replace("\t", "") if int(pag_actual) > 1: pag_ant = int(pag_actual) - 1 url_prev = plugintools.find_single_match( bloque_paginacion, '<a rel="nofollow" href="([^"]+)"') plugintools.addDir(action="Secciones_Ivoox", url=url_prev, title="[COLOR blue][I]" + str(pag_ant) + " « Página anterior ·" + ec5 + ' ' * 25, thumbnail=logo, fanart=fanart_secc, folder=True, isPlayable=False) pag_sig = plugintools.find_single_match( bloque_paginacion, '<a href="#" class="disabled">.*?title=".*?">\s+(.*?)\s+</a>') if pag_sig != "": url_next = plugintools.find_single_match( bloque_paginacion, '<a href="#" class="disabled">.*?href="([^"]+)"') plugintools.addDir(action="Secciones_Ivoox", url=url_next, title=' ' * 25 + "[COLOR blue][I]Página siguiente » " + str(pag_sig) + "[/I][/COLOR]", thumbnail=logo, fanart=fanart_secc, folder=True, isPlayable=False)
def multi_analyzer(params): plugintools.log('[%s %s] multi_analyzer %s' % (addonName, addonVersion, repr(params))) url = params.get("url");title='[COLOR white]'+params.get("title").replace("[I][Multi][/I]","").strip()+'[/COLOR]';title = multiparse_title(title,url) thumbnail = params.get("thumbnail");fanart=params.get("fanart");datamovie={};datamovie["plot"] = params.get("plot") if url.startswith("plugin") == True: plot = params.get("plot") title=params.get("title").replace("[I][Multi][/I]", "").strip() plugin_analyzer(url, title, plot, datamovie, thumbnail, fanart) elif url.startswith("llamada") == True: plot = params.get("plot") title=params.get("title") # .replace("[Multi]", "").strip() url = url.replace("llamada:", "") comandos = url.split("; ") fich_llamada = ruta_llamadas + comandos[0] + ".txt" # El 1º es el nombre del fichero archivo_llamada = open(fich_llamada, "r") url_llamada = archivo_llamada.read() num_comandos = len(comandos) for comando in range(1, num_comandos): # Empiezo en 1 para saltarme el 1º, q es el nombre del fichero, no un "comando" a reemplazar sustituye = plugintools.find_single_match(comandos[comando],'(.*?)=') por_este = plugintools.find_single_match(comandos[comando],'=(.*)') url_llamada = url_llamada.replace(sustituye, por_este) thumbnail=params.get("thumbnail") fanart=params.get("fanart") plugin_analyzer(url_llamada, title, plot, datamovie, thumbnail, fanart) elif url.startswith("bum") == True: #title_fixed = multiparse_title(title, url) try: min_seeds=url.split("_")[1]; except: min_seeds="" plugintools.addDir(action = "bum_linker" , title = title, url = url.replace("bum:", "").strip(), thumbnail = thumbnail, extra=url.replace("bum:", ""), page=min_seeds, fanart = fanart , folder = True , isPlayable = False ) elif url.startswith("devil:") == True: url = url.replace("devil:", "").replace(" referer=","%26referer=") url = 'plugin://plugin.video.SportsDevil/?mode=1&item=catcher%3dstreams%26url='+url # +'%26referer='+referer plugintools.add_item(action="runPlugin", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder = False, isPlayable=True) # Linkers de películas y series elif url.startswith("peli") == True or url.startswith("serie") == True: linker,lbl_linker = linker_analyzer(url);url = url.replace("peli:", "");url = url.replace("serie:", "") plugintools.add_item(action=linker, title=title, url=url, extra="linker", page=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=True, isPlayable=False) # Youtube add-on endpoints elif url.startswith("yt_playlist") == True: # Youtube add-on Playlist pid = url.replace("yt_playlist(", "").replace(")", "").replace(" ", "").strip() url = 'plugin://plugin.video.youtube/playlist/'+pid+'/' plugintools.add_item(action="runPlugin", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=True, isPlayable=False) elif url.startswith("yt_channel") == True: # Youtube add-on Channel cid = url.replace("yt_channel(", "").replace(")", "").replace(" ", "").strip() url = 'plugin://plugin.video.youtube/channel/'+cid+'/' plugintools.add_item(action="runPlugin", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=True, isPlayable=False) elif url.startswith("yt_user") == True: # Youtube add-on User uid = url.replace("yt_user(", "").replace(")", "").replace(" ", "").strip() url = 'plugin://plugin.video.youtube/user/'+uid+'/' plugintools.add_item(action="runPlugin", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=True, isPlayable=False) elif url.startswith("yt_video") == True: # Youtube add-on Video vid = url.replace("yt_video(", "").replace(")", "").replace(" ", "") url = 'plugin://plugin.video.youtube/play/?video_id='+vid plugintools.runAddon(action="play", title=title, url=url.strip(), thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=True) elif url.startswith("rtmp") == True or url.startswith("rtsp") == True: plugintools.add_item(action="rtmp_analyzer", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=True) elif url.startswith("pvr://") == True: plugintools.add_item( action="runPlugin" , title=title , url=url , thumbnail=thumbnail , fanart=fanart , folder = False , isPlayable = False ) elif url.startswith("http") == True: server = video_analyzer(url) if server != "unknown": plugintools.add_item(action=server, title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=True) elif url.find("dailymotion.com/video") >= 0: video_id = dailym_getvideo(url) if video_id != "": thumbnail = "https://api.dailymotion.com/thumbnail/video/"+video_id+"" url = "plugin://plugin.video.dailymotion_com/?url="+video_id+"&mode=playVideo" plugintools.add_item(action="dailym_getvideo", title=title, url=url, thumbnail=thumbnail, fanart=params.get("fanart"), info_labels=datamovie, folder=False, isPlayable=True) elif url.find("dailymotion.com/playlist") >= 0: id_playlist = dailym_getplaylist(url) if id_playlist != "": url = "https://api.dailymotion.com/playlist/"+id_playlist+"/videos" thumbnail = "https://api.dailymotion.com/thumbnail/video/"+id_playlist if thumbnail == "": thumbnail = 'http://press.dailymotion.com/wp-old/wp-content/uploads/logo-Dailymotion.png' url = "https://api.dailymotion.com/playlist/"+id_playlist+"/videos" plugintools.add_item(action="dailym_pl", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=True, isPlayable=False) elif url.find("vimeo.com") >= 0: # Vimeo if url.find("vimeo.com/channels") >= 0: plugintools.addDir( action = "vimeo_pl" , title = title, url = url , thumbnail = thumbnail , fanart = fanart , folder = True , isPlayable = False ) else: plugintools.addShow( action = "vimeo" , title = title, url = url , thumbnail = thumbnail , fanart = fanart , folder = False , isPlayable = True ) elif url.find("https://www.youtube.com/watch?") >= 0: plot = params.get("plot") title=params.get("title").replace("[I][Multi][/I]", "").strip() videoid = url.replace("https://www.youtube.com/watch?v=", "") url = 'plugin://plugin.video.youtube/play/?video_id='+videoid plugin_analyzer(url, title, plot, datamovie, thumbnail, fanart) elif url.find(".m3u8") >= 0: plugintools.add_item(action="play", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=True) else: plugintools.add_item(action="play", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=True) elif url.startswith("udp") == True: plugintools.add_item(action="play", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=True) elif url.startswith("rtp") == True: plugintools.add_item(action="play", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=True) elif url.startswith("mms") == True: plugintools.add_item(action="play", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=True) elif url.startswith("sop") == True: # plugin://plugin.video.p2p-streams/?url=sop://124.232.150.188:3912/11265&mode=2&name=Titulo+canal+Sopcast url = 'plugin://plugin.video.p2p-streams/?url=' + url + '&mode=2&name=' plugintools.add_item(action="play", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=False) elif url.startswith("ace") == True: url = url.replace("ace:", "") url = 'plugin://plugin.video.p2p-streams/?url=' + url + '&mode=1&name=' plugintools.add_item(action="play", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=False) elif url.startswith("short") == True: url = url.replace("short:", "").strip() plugintools.add_item(action="longurl", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=True, isPlayable=False) elif url.startswith("devil") == True: url_devil = url.replace("devil:", "").replace(" referer=","%26referer=") url = 'plugin://plugin.video.SportsDevil/?mode=1&item=catcher%3dstreams%26url='+url_devil # +'%26referer='+referer #xbmc.executebuiltin('XBMC.RunPlugin(' + url +')') plugintools.add_item(action="runPlugin", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=False) elif url.startswith("bum") == True: plugintools.add_item(action="bum_multiparser", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=True, isPlayable=False) elif url.startswith("txt") == True: from resources.tools.txt_reader import * url=url.replace("txt:", "") plugintools.add_item(action="txt_reader", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=False) elif url.startswith("epg-txt") == True: from resources.tools.epg_txt import * url=url.replace("epg-txt:", "") url = epg_txt_dict(parser_title(url)) plugintools.add_item(action="epg_txt0", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=False) elif url.startswith("agendatv") == True: url = url.replace("agendatv:", "").strip() if url.startswith("futbolenlatv") == True: if url.endswith("futbol") == True: url='http://www.futbolenlatv.com/deporte/futbol' elif url.endswith("futsal") == True: url='http://www.futbolenlatv.com/deporte/futbol-sala' elif url.endswith("baloncesto") == True: url='http://www.futbolenlatv.com/deporte/baloncesto' elif url.endswith("balonmano") == True: url='http://www.futbolenlatv.com/deporte/balonmano' elif url.endswith("motociclismo") == True: url='http://www.futbolenlatv.com/deporte/motociclismo' elif url.endswith("automovilismo") == True: url='http://www.futbolenlatv.com/deporte/automovilismo' elif url.endswith("amfutbol") == True: url='http://www.futbolenlatv.com/deporte/futbol-americano' elif url.endswith("tenis") == True: url='http://www.futbolenlatv.com/deporte/tenis' elif url.endswith("rugby") == True: url='http://www.futbolenlatv.com/deporte/rugby' elif url.endswith("ciclismo") == True: url='http://www.futbolenlatv.com/deporte/ciclismo' elif url.endswith("todos") == True: url='http://www.futbolenlatv.com/deporte' plugintools.add_item(action="feltv0", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=False) elif url == "footballonuktv": url = 'http://www.footballonuktv.com/' plugintools.add_item(action="agendatv", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=False) elif url == "calciointv": url = 'http://www.calciointv.com/' plugintools.add_item(action="agendatv", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=False) elif url == "futbolenlatele": url = 'http://www.futbolenlatele.com' plugintools.add_item(action="agendatv", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=False) elif url == "queverahora": url = 'http://www.formulatv.com/programacion/' plugintools.add_item(action="epg_verahora", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=False) else: plugintools.add_item(action="play", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=True, isPlayable=False) elif url.startswith("torrent") == True: url = p2p_builder_url(url, title, p2p="torrent") plugintools.add_item(action="launch_torrent", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=True) elif url.startswith("magnet") == True: url = p2p_builder_url(url, title, p2p="magnet") plugintools.add_item(action="launch_magnet", title=title, url=url, thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=False, isPlayable=True) elif url == "mundoplus": plugintools.add_item(action="mundoplus_guide", title=title, url=url, thumbnail=thumbnail, fanart=fanart, page=params.get("page"), info_labels=datamovie, folder=True, isPlayable=False) elif url.startswith("goear") == True: id_goear = url.replace("goear:", "").replace('"', "").strip() url = 'http://www.goear.com/action/sound/get/'+id_goear plugintools.add_item(action="play", title=title, url=url, thumbnail=thumbnail, fanart=fanart, extra="regex", info_labels=datamovie, folder=True, isPlayable=False) else: plugintools.add_item(action="play", title=title, url=url, thumbnail=thumbnail, fanart=fanart, extra="regex", info_labels=datamovie, folder=True, isPlayable=False)
def onhockey(params): plugintools.log("[tv.ultra.7k 0.3.0].Onhockey") datamovie = {} datamovie[ "Plot"] = '[B]OnHockey.TV[/B] es un portal de streaming en vivo de las mejores ligas de Hockey, resultados en vivo y chat en varios idiomas.[CR][CR]En exclusiva en [COLOR lightyellow]tv.ultra.7k[/COLOR]' plugintools.addShow( action="", title= '[COLOR red][B]O N [/COLOR][COLOR blue] H O C K E Y[/COLOR][COLOR white] .T V[/COLOR] [/B][COLOR lightyellow][I]By Juarrox[/I][/COLOR]', url="", thumbnail=thumbnail, info_labels=datamovie, fanart=fanart, folder=False, isPlayable=False) datamovie[ "Plot"] = 'La hora aparece de acuerdo al horario de Londres (GMT +1), mostrándose en color [B][COLOR green]verde[/B][/COLOR] cuando se activan los enlaces minutos antes del inicio de cada partido.' plugintools.addShow( action="", title='[COLOR white][B]Horario de Londres (GMT +1)[/COLOR][/B]', url="", thumbnail=thumbnail, fanart= 'https://scontent-mad1-1.xx.fbcdn.net/hphotos-ash2/v/t1.0-9/10154532_10203598321336679_8880512652119508392_n.jpg?oh=0c0a0f5a2fb411a8f5445e9149e4c8e0&oe=569B2B5B', info_labels=datamovie, folder=False, isPlayable=False) # Vamos a obtener la programación de OnHockey.TV url = 'http://onhockey.tv/schedule_table_eng.php?_=1444691616045' referer = 'http://www.onhockey.tv/' schedule = gethttp_referer_headers(url, referer) plugintools.log("programación?= " + schedule) NHL = plugintools.find_single_match(schedule, '<b>NHL</b>(.*?)<b>') if NHL == "": NHL = plugintools.find_single_match( schedule, '<b>NHL</b>(.*?)</table>' ) # Se controla el caso en que solo haya eventos NHL hockeygames(NHL, 'NHL') KHL = plugintools.find_single_match(schedule, '<b>KHL</b>(.*?)<td class') if KHL == "": KHL = plugintools.find_single_match( schedule, '<b>KHL</b>(.*?)</table>' ) # Se controla el caso en que solo haya eventos KHL hockeygames(KHL, 'KHL') KHC = plugintools.find_single_match(schedule, '<b>KHC</b>(.*?)<td class') Liiga = plugintools.find_single_match(schedule, '<b>Liiga</b>(.*?)<td class') hockeygames(Liiga, 'Liiga') PHL = plugintools.find_single_match(schedule, '<b>PHL</b>(.*?)<td class') hockeygames(PHL, 'PHL') SHL = plugintools.find_single_match(schedule, '<b>SHL</b>(.*?)<td class') hockeygames(SHL, 'SHL') VHL = plugintools.find_single_match(schedule, '<b>VHL</b>(.*?)<td class') hockeygames(VHL, 'VHL') Allsvenskan = plugintools.find_single_match( schedule, '<b>Allsvenskan</b>(.*?)<td class') #eventosVHL-B = plugintools.find_single_match(schedule, '<b>VHL-B</b>(.*?)</script>') xbmc.executebuiltin("Container.SetViewMode(515)")
def hockeygames(hockeyliga, nameliga): # Asociamos logo de la liga if nameliga == "NHL": thumbnail = 'http://www.sports-logos-screensavers.com/user/NHL_Logo_New2.jpg' fanart = 'http://www.zastavki.com/pictures/1920x1200/2011/Sport_Hockey_Jose_Theodore__NHL_027113_.jpg' elif nameliga == "KHL": thumbnail = 'https://upload.wikimedia.org/wikipedia/en/thumb/c/c1/KHL_logo_shield.svg/200px-KHL_logo_shield.svg.png' fanart = 'http://promoovertime.com/wp-content/uploads/2014/11/Arena-Zagreb-1080x675.jpg' elif nameliga == "Liiga": thumbnail = 'https://upload.wikimedia.org/wikipedia/en/c/cd/Liiga_logo.png' fanart = 'https://i.vimeocdn.com/video/448377853_640.jpg' elif nameliga == "SHL": thumbnail = 'http://testbed.krank.se/shl/shl_logga.jpg' fanart = 'http://i42.tinypic.com/qzj72g.jpg' elif nameliga == "VHL": thumbnail = 'https://upload.wikimedia.org/wikipedia/en/thumb/3/39/Supreme_Hockey_League.svg/180px-Supreme_Hockey_League.svg.png' fanart = 'http://www.stickwithcarter.com/wp-content/uploads/2010/07/goalie_making_save-1.jpg' elif nameliga == "PHL": thumbnail = 'https://upload.wikimedia.org/wikipedia/fr/6/64/PHL.png' fanart = 'http://www.przegladsportowy.pl/m/Repozytorium.Podglad.aspx/1200/0/przegladsportowy/635620528189574532.jpg' # Obtenemos lista de canales y su clave eventos = plugintools.find_multiple_matches(hockeyliga, '<tr(.*?)</div>') for entry in eventos: canales_dict = [] tipo_dict = [] plugintools.log("EVENTO= " + entry) #<tr><td><text class="game_hour" align="left">00</text>:00</td><td>Philadelphia - New Jersey</td> hora = plugintools.find_single_match(entry, "<td>(.*?)</td><td>") hora = hora.replace("<text class='game_hour' align='left'>", "") hora = hora.replace("</text>", "") plugintools.log("hora= " + hora) partido = plugintools.find_single_match(entry, '</td><td>(.*?)\n') title_fixed = partido.replace(" \x96 ", " vs ") title_fixed = title_fixed.replace(" - ", " vs ") partido = title_fixed.replace("vs", " ") partido = title_fixed.replace("-", "") partido = title_fixed.replace("\x96", "") #partido = title_fixed.replace(" ","") plugintools.log("partido= " + partido) channels = plugintools.find_multiple_matches(entry, "<a href='([^']+)") channelist = "" datamovie = {} for entry in channels: plugintools.log("channel= " + entry) entry = 'http://onhockey.tv/' + entry if channelist == "": channelist = entry else: channelist = channelist + ', ' + entry print channelist datamovie["Plot"] = channelist if len(channelist) >= 1: plugintools.addShow(action="multihockey", title='[COLOR green][B]' + hora + '[/B][/COLOR] [COLOR lightyellow][B]' + nameliga + '[/B][/COLOR] [COLOR white]' + partido + '[/COLOR]', url="", thumbnail=thumbnail, fanart=fanart, plot=channelist, info_labels=datamovie, folder=False, isPlayable=True) else: plugintools.addShow(action="", title='[COLOR red][B]' + hora + '[/B][/COLOR] [COLOR lightyellow][B]' + nameliga + '[/B][/COLOR] [COLOR white]' + partido + '[/COLOR]', url="", thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=True) xbmc.executebuiltin("Container.SetViewMode(515)")