def bonus(params): content = Open_URL(plist) matches = re.compile('name="(.+?)"stream="(.+?)"').findall(content) for item in matches: name = item[0] stream = item[1] plugintools.addDir(title= name, icon = ICON, url = stream, fanart = FANART)
def ivoox0(params): plugintools.log("[%s %s] Ivoox Parser... %s " % (addonName, addonVersion, repr(params))) name = 'Ivoox.com' update = '19/04/2016 21:00' Autor = 'V1k1ng0' url = 'https://www.cubbyusercontent.com/pl/ivoox.py/_9d46d7480ad7445286f1b6499a994b82' r = requests.get(web) data = r.content #print data infolabels = {} # Secciones Home ------------------------------>> titulo = ' ' * 21 + "[COLOR sienna][B]-IVOOX-[/B][/COLOR][COLOR red][I] " + version + "[/I][/COLOR]" infolabels[ "plot"] = sc5 + "· Autor del Parser: V1k1ng0 · · Autor del Regex: Aquilesserr · " + ec5 plugintools.add_item(action="", url="", title=titulo, thumbnail=thumbnail, info_labels=infolabels, fanart=fanart, folder=False, isPlayable=False) plugintools.add_item( action="", url="", title="", thumbnail= 'https://www.cubbyusercontent.com/pl/LogoParser.png/_a6d13ccdcbce474eb2afb9707a01d78c', fanart=fanart, folder=False, isPlayable=False) plugintools.addDir( action="ivoox_search", url="http://www.ivoox.com/podcast_sc_f443.67_1.html", title='[COLOR lightyellow][B]Buscar podcast...[/B][/COLOR]', thumbnail=logo_AudioLibros, fanart=fanart_AudioLibros, folder=True, isPlayable=False) plugintools.addDir(action="Secciones_Ivoox", url="http://www.ivoox.com/audios_sa_f_1.html", title=sc + "· A La Carta ·" + ec + sc1 + "[Podcast]" + ec1, thumbnail=logo_AlaCarta, fanart=fanart, folder=True, isPlayable=False) plugintools.addDir( action="Secciones_Ivoox", url="http://www.ivoox.com/audios-historia-creencias_sa_f31_1.html", title=sc + "· Historias y Creencias ·" + ec + sc1 + "[Podcast]" + ec1, thumbnail=logo_HC, fanart=fanart_HC, folder=True, isPlayable=False) plugintools.addDir(action="Secciones_Ivoox", url="http://www.ivoox.com/audios-deporte_sa_f33_1.html", title=sc + "· Deporte ·" + ec + sc1 + "[Podcast]" + ec1, thumbnail=logo_Deporte, fanart=fanart_Deporte, folder=True, isPlayable=False) plugintools.addDir( action="Secciones_Ivoox", url="http://www.ivoox.com/audios-ciencia-cultura_sa_f36_1.html", title=sc + "· Ciencia y Cultura ·" + ec + sc1 + "[Podcast]" + ec1, thumbnail=logo_CC, fanart=fanar_CC, folder=True, isPlayable=False) plugintools.addDir(action="Secciones_Ivoox", url="http://www.ivoox.com/audios-ocio_sa_f35_1.html", title=sc + "· Ocio ·" + ec + sc1 + "[Podcast]" + ec1, thumbnail=logo_Ocio, fanart=fanart_Ocio, folder=True, isPlayable=False) plugintools.addDir( action="Secciones_Ivoox", url="http://www.ivoox.com/escuchar-radio-online_sr_f_1.html", title=sc + "· Radio On-Line ·" + ec + sc1 + "[Radios Online]" + ec1, thumbnail=logo_Radio, fanart=fanart_Radio, folder=True, isPlayable=False) plugintools.addDir( action="Secciones_Ivoox", url="http://www.ivoox.com/audios-actualidad-sociedad_sa_f37_1.html", title=sc + "· Actualidad y Sociedad ·" + ec + sc1 + "[Podcast]" + ec1, thumbnail=logo_AS, fanart=fanart_AS, folder=True, isPlayable=False) plugintools.addDir(action="Secciones_Ivoox", url="http://www.ivoox.com/audios-musica_sa_f311_1.html", title=sc + "· Música ·" + ec + sc1 + "[Podcast]" + ec1, thumbnail=logo_Musica, fanart=fanart_Musica, folder=True, isPlayable=False) plugintools.addDir( action="Secciones_Ivoox", url="http://www.ivoox.com/audios-bienestar-familia_sa_f39_1.html", title=sc + "· Bienestar y Familia ·" + ec + sc1 + "[Podcast]" + ec1, thumbnail=logo_BF, fanart=fanart_BF, folder=True, isPlayable=False) plugintools.addDir( action="Secciones_Ivoox", url="http://www.ivoox.com/audios-empresa-tecnologia_sa_f38_1.html", title=sc + "· Empresas y Tecnologia ·" + ec + sc1 + "[Podcast]" + ec1, thumbnail=logo_ET, fanart=fanart_ET, folder=True, isPlayable=False) plugintools.addDir(action="Secciones_Ivoox", url="http://www.ivoox.com/podcast_sc_f443.67_1.html", title=sc + "· Audio Libros ·" + ec + sc1 + "[Podcast]" + ec1, thumbnail=logo_AudioLibros, fanart=fanart_AudioLibros, folder=True, 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 xhamster0(params): plugintools.log('[%s %s] Parseando XHamter %s' % (addonName, addonVersion, repr(params))) name = 'XHamster' update = '02/07/2016 18:00' Autor = 'PM' url = 'http://stec-site.xhcdn.com/images/logo/logo.png' r = requests.get(web) data = r.content #print data plugintools.addDir(action="", url="", title='[COLOR lightblue][B]Xhamster[/B]' + version + '[/COLOR]', thumbnail=thumbnail, fanart=fanart, folder=False, isPlayable=False) plugintools.addDir(action="xhamster_bus", url=web, title=sc2 + 'Buscar Canal >>' + ec2, thumbnail=thumbnail, fanart=fanart, folder=True, isPlayable=False) if plugintools.get_setting("xh_hetero") == "true": categoria_het = plugintools.find_single_match( data, 'class="title">Heterosexual</div>(.*?)class="catName"') categ_het = plugintools.find_multiple_matches(categoria_het, 'class="btnBig"(.*?)<a') datamovie = {} for entry in categ_het: # plugintools.log("entry= "+entry) datamovie["Plot"] = plugintools.find_single_match( entry, 'hint="([^"]+)') url_item = plugintools.find_single_match(entry, 'href="([^"]+)').strip() title_item = plugintools.find_single_match( entry, '</div>(.*?)</a>').strip() if title_item == "": title_item = plugintools.find_single_match( entry, '>(.*?)</a>').strip() if title_item: plugintools.addDir(action="xhamster1", url=url_item, title=sc + title_item + ec + "[COLOR green] [Hetero][/COLOR]", thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=True, isPlayable=False) datamovie[ "Plot"] = "" # Vaciamos esta variable para que actualice valor en la siguiente entrada xbmcplugin.addSortMethod(int(sys.argv[1]), 1) if plugintools.get_setting("xh_trans") == "true": categoria_trans = plugintools.find_single_match( data, '<div class="title">Transexuales</div>(.*?)class="catName"') categ_trans = plugintools.find_multiple_matches( categoria_trans, 'class="btnBig"(.*?)<a') datamovie = {} for entry in categ_trans: # plugintools.log("entry= "+entry) datamovie["Plot"] = plugintools.find_single_match( entry, 'hint="([^"]+)') url_item = plugintools.find_single_match(entry, 'href="([^"]+)').strip() title_item = plugintools.find_single_match( entry, '</div>(.*?)</a>').strip() if title_item == "": title_item = plugintools.find_single_match( entry, '>(.*?)</a>').strip() if title_item: plugintools.addDir(action="xhamster1", url=url_item, title=sc + title_item + ec + "[COLOR yellow] [Transexuales][/COLOR]", thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=True, isPlayable=False) datamovie[ "Plot"] = "" # Vaciamos esta variable para que actualice valor en la siguiente entrada xbmcplugin.addSortMethod(int(sys.argv[1]), 1) if plugintools.get_setting("xh_gay") == "true": categoria_gay = plugintools.find_single_match( data, '<div class="title">Gays</div>(.*?)<div id="footer">') categ_gay = plugintools.find_multiple_matches(categoria_gay, 'class="btnBig"(.*?)<a') datamovie = {} for entry in categ_gay: # plugintools.log("entry= "+entry) datamovie["Plot"] = plugintools.find_single_match( entry, 'hint="([^"]+)') url_item = plugintools.find_single_match(entry, 'href="([^"]+)').strip() title_item = plugintools.find_single_match( entry, '</div>(.*?)</a>').strip() if title_item == "": title_item = plugintools.find_single_match( entry, '>(.*?)</a>').strip() if title_item: plugintools.addDir(action="xhamster1", url=url_item, title=sc + title_item + ec + "[COLOR red] [Gays][/COLOR]", thumbnail=thumbnail, fanart=fanart, info_labels=datamovie, folder=True, isPlayable=False) datamovie[ "Plot"] = "" # Vaciamos esta variable para que actualice valor en la siguiente entrada xbmcplugin.addSortMethod(int(sys.argv[1]), 1)
def check_update(params): plugintools.log("[%s %s] Checking updates... %s" % (addonName, addonVersion, repr(params))) data = plugintools.read(params.get("url")) plotter = "" datamovie = {} #plugintools.log("data= "+data) title = params.get("title") name_channel = parser_title(title) print name_channel data_update = plugintools.find_single_match( data, '<name>' + name_channel + '(.*?)</channel>') print data_update subchannel = plugintools.find_multiple_matches( data_update, '<subchannel>(.*?)</subchannel>') i = 0 for entry in subchannel: try: 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)) # Última modificación del archivo 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.log("[%s %s] Nueva actualización: %s " % (addonName, addonVersion, path)) i = i + 1 # Guardamos sinopsis de actualizaciones if plotter == "": plotter = '[COLOR white]' + title + '[/COLOR][COLOR lightblue][I] [' + author + '][/I][/COLOR][COLOR lightgreen][I] [' + version + '][/I][/COLOR]' else: plotter = plotter + '[CR]' + '[COLOR white]' + title + '[/COLOR][COLOR lightblue][I] [' + author + '][/I][/COLOR][COLOR lightgreen][I] [' + version + '][/I][/COLOR]' except: plugintools.log("Error en lectura de entrada: " + title) pass if i != 0: datamovie["Plot"] = plotter plugintools.addDir( action="updater_menu", title='[COLOR lightblue]Actualizaciones [COLOR lightyellow][B][I](' + str(i) + ')[/COLOR][/I][/B][/COLOR]', url=params.get("url"), plot=params.get("plot"), info_labels=datamovie, thumbnail=params.get("thumbnail"), fanart=params.get("fanart"), folder=True, isPlayable=False) else: pass