diff --git a/plugin.video.alfa/addon.xml b/plugin.video.alfa/addon.xml index dde43615..82140bc8 100755 --- a/plugin.video.alfa/addon.xml +++ b/plugin.video.alfa/addon.xml @@ -1,5 +1,5 @@ - + @@ -19,17 +19,17 @@ [B]Estos son los cambios para esta versión:[/B] [COLOR green][B]Canales agregados y arreglos[/B][/COLOR] - ¤ allcalidad ¤ cinecalidad - ¤ repelis ¤ cumlouder - ¤ porntrex ¤ crunchyroll - ¤ pedropolis ¤ pepecine + ¤ repelis ¤ thevid + ¤ vevio ¤ danimados + ¤ sipeliculas ¤ cinecalidad + ¤ locopelis ¤ pelisipad ¤ divxtotal ¤ elitetorrent ¤ estrenosgo ¤ grantorrent ¤ mejortorrent1 ¤ newpct1 - ¤ danimados ¤ fanpelis - ¤ repelis + ¤ tvvip ¤ zonatorrent + ¤ maxipelis24 ¤ wikiseries ¤ arreglos internos - ¤ Agradecimientos a @angedam, @chivmalev, @alaquepasa por colaborar en ésta versión + ¤ Agradecimientos a @angedam y @chivmalev por colaborar en ésta versión Navega con Kodi por páginas web para ver sus videos de manera fácil. diff --git a/plugin.video.alfa/channels/animejl.py b/plugin.video.alfa/channels/animejl.py index b02569b7..ff65b206 100644 --- a/plugin.video.alfa/channels/animejl.py +++ b/plugin.video.alfa/channels/animejl.py @@ -161,6 +161,7 @@ def findvideos(item): itemlist.extend(servertools.find_video_items(data=data)) for videoitem in itemlist: + videoitem.channel = item.channel videoitem.title = '[%s]' % videoitem.server.capitalize() return itemlist diff --git a/plugin.video.alfa/channels/cinecalidad.py b/plugin.video.alfa/channels/cinecalidad.py index 476b66fb..912048a7 100644 --- a/plugin.video.alfa/channels/cinecalidad.py +++ b/plugin.video.alfa/channels/cinecalidad.py @@ -324,7 +324,7 @@ def findvideos(item): url = server_url[server_id] + video_id + '.html' elif server_id == 'BitTorrent': import urllib - base_url = '%sprotect/v.php' % host + base_url = '%s/protect/v.php' % host post = {'i':video_id, 'title':item.title} post = urllib.urlencode(post) headers = {'Referer':item.url} diff --git a/plugin.video.alfa/channels/divxtotal.py b/plugin.video.alfa/channels/divxtotal.py index 8e1ba213..1a0deaf5 100644 --- a/plugin.video.alfa/channels/divxtotal.py +++ b/plugin.video.alfa/channels/divxtotal.py @@ -519,17 +519,35 @@ def findvideos(item): item, itemlist = generictools.post_tmdb_findvideos(item, itemlist) #Ahora tratamos los enlaces .torrent - for scrapedurl in matches: #leemos los torrents con la diferentes calidades + for scrapedurl in matches: #leemos los torrents con la diferentes calidades #Generamos una copia de Item para trabajar sobre ella item_local = item.clone() + #Buscamos si ya tiene tamaño, si no, los buscamos en el archivo .torrent + size = scrapertools.find_single_match(item_local.quality, '\s\[(\d+,?\d*?\s\w\s?[b|B])\]') + if not size: + size = generictools.get_torrent_size(item_local.url) #Buscamos el tamaño en el .torrent + if size: + item_local.title = re.sub(r'\s\[\d+,?\d*?\s\w[b|B]\]', '', item_local.title) #Quitamos size de título, si lo traía + item_local.title = '%s [%s]' % (item_local.title, size) #Agregamos size al final del título + size = size.replace('GB', 'G B').replace('Gb', 'G b').replace('MB', 'M B').replace('Mb', 'M b') + item_local.quality = re.sub(r'\s\[\d+,?\d*?\s\w\s?[b|B]\]', '', item_local.quality) #Quitamos size de calidad, si lo traía + item_local.quality = '%s [%s]' % (item_local.quality, size) #Agregamos size al final de la calidad + #Ahora pintamos el link del Torrent item_local.url = scrapedurl if host not in item_local.url and host.replace('https', 'http') not in item_local.url : item_local.url = host + item_local.url - item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][Torrent][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.quality, str(item_local.language)) #Preparamos título de Torrent - item_local.title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title) #Quitamos etiquetas vacías - item_local.title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', item_local.title) #Quitamos colores vacíos + item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][Torrent][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (item_local.quality, str(item_local.language)) + + #Preparamos título y calidad, quitamos etiquetas vacías + item_local.title = re.sub(r'\s?\[COLOR \w+\]\[\[?\s?\]?\]\[\/COLOR\]', '', item_local.title) + item_local.title = re.sub(r'\s?\[COLOR \w+\]\s?\[\/COLOR\]', '', item_local.title) + item_local.title = item_local.title.replace("--", "").replace("[]", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip() + item_local.quality = re.sub(r'\s?\[COLOR \w+\]\[\[?\s?\]?\]\[\/COLOR\]', '', item_local.quality) + item_local.quality = re.sub(r'\s?\[COLOR \w+\]\s?\[\/COLOR\]', '', item_local.quality) + item_local.quality = item_local.quality.replace("--", "").replace("[]", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip() + item_local.alive = "??" #Calidad del link sin verificar item_local.action = "play" #Visualizar vídeo item_local.server = "torrent" #Seridor Torrent diff --git a/plugin.video.alfa/channels/elitetorrent.py b/plugin.video.alfa/channels/elitetorrent.py index 6842c037..1a052a4a 100644 --- a/plugin.video.alfa/channels/elitetorrent.py +++ b/plugin.video.alfa/channels/elitetorrent.py @@ -171,8 +171,11 @@ def listado(item): #Limpiamos el título de la basura innecesaria title = title.replace("Dual", "").replace("dual", "").replace("Subtitulada", "").replace("subtitulada", "").replace("Subt", "").replace("subt", "").replace("Sub", "").replace("sub", "").replace("(Proper)", "").replace("(proper)", "").replace("Proper", "").replace("proper", "").replace("#", "").replace("(Latino)", "").replace("Latino", "") - title = title.replace("- HDRip", "").replace("(HDRip)", "").replace("- Hdrip", "").replace("(microHD)", "").replace("(DVDRip)", "").replace("(HDRip)", "").replace("(BR-LINE)", "").replace("(HDTS-SCREENER)", "").replace("(BDRip)", "").replace("(BR-Screener)", "").replace("(DVDScreener)", "").replace("TS-Screener", "").replace(" TS", "").replace(" Ts", "") + title = title.replace("- HDRip", "").replace("(HDRip)", "").replace("- Hdrip", "").replace("(microHD)", "").replace("(DVDRip)", "").replace("(HDRip)", "").replace("(BR-LINE)", "").replace("(HDTS-SCREENER)", "").replace("(BDRip)", "").replace("(BR-Screener)", "").replace("(DVDScreener)", "").replace("TS-Screener", "").replace(" TS", "").replace(" Ts", "").replace("temporada", "").replace("Temporada", "").replace("capitulo", "").replace("Capitulo", "") + + title = re.sub(r'(?:\d+)?x.?\s?\d+', '', title) title = re.sub(r'\??\s?\d*?\&.*', '', title).title().strip() + item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título if item_local.extra == "peliculas": #preparamos Item para películas @@ -190,16 +193,17 @@ def listado(item): item_local.contentType = "episode" item_local.extra = "series" epi_mult = scrapertools.find_single_match(item_local.url, r'cap.*?-\d+-al-(\d+)') - item_local.contentSeason = scrapertools.find_single_match(item_local.url, r'temp.*?-(\d+)') + item_local.contentSeason = scrapertools.find_single_match(item_local.url, r'temporada-(\d+)') item_local.contentEpisodeNumber = scrapertools.find_single_match(item_local.url, r'cap.*?-(\d+)') if not item_local.contentSeason: item_local.contentSeason = scrapertools.find_single_match(item_local.url, r'-(\d+)[x|X]\d+') if not item_local.contentEpisodeNumber: item_local.contentEpisodeNumber = scrapertools.find_single_match(item_local.url, r'-\d+[x|X](\d+)') - if item_local.contentSeason < 1: - item_local.contentSeason = 1 + if not item_local.contentSeason or item_local.contentSeason < 1: + item_local.contentSeason = 0 if item_local.contentEpisodeNumber < 1: item_local.contentEpisodeNumber = 1 + item_local.contentSerieName = title if epi_mult: title = "%sx%s al %s -" % (item_local.contentSeason, str(item_local.contentEpisodeNumber).zfill(2), str(epi_mult).zfill(2)) #Creamos un título con el rango de episodios @@ -269,11 +273,11 @@ def findvideos(item): #data = unicode(data, "utf-8", errors="replace") #Añadimos el tamaño para todos - size = scrapertools.find_single_match(item.quality, '\s\[(\d+,?\d*?\s\w[b|B]s)\]') + size = scrapertools.find_single_match(item.quality, '\s\[(\d+,?\d*?\s\w\s?[b|B]s)\]') if size: item.title = re.sub('\s\[\d+,?\d*?\s\w[b|B]s\]', '', item.title) #Quitamos size de título, si lo traía item.title = '%s [%s]' % (item.title, size) #Agregamos size al final del título - item.quality = re.sub('\s\[\d+,?\d*?\s\w[b|B]s\]', '', item.quality) #Quitamos size de calidad, si lo traía + item.quality = re.sub('\s\[\d+,?\d*?\s\w\s?[b|B]s\]', '', item.quality) #Quitamos size de calidad, si lo traía patron_t = '
Géneros.*?
') + patron = '([^<]+)<' + elif item.cat == 'year': + data = scrapertools.find_single_match(data, '

Año de estreno.*?') + patron = 'li>([^<]+).*?<' + elif item.cat == 'quality': + data = scrapertools.find_single_match(data, '

Calidad.*?') + patron = 'li>([^<]+)<' + + matches = re.compile(patron, re.DOTALL).findall(data) + for scrapedurl , scrapedtitle in matches: + itemlist.append(Item(channel=item.channel, action='movies', title=scrapedtitle, url=scrapedurl, type='cat', first=0)) + return itemlist + +def movies(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|\s{2}| ","", data) + + patron = '
(.*?)
') + + # Busca los enlaces a los videos + listavideos = servertools.findvideos(data) + + for video in listavideos: + videotitle = scrapertools.unescape(video[0]) + url = video[1] + server = video[2] + + itemlist.append(Item(channel=item.channel, action="play", server=server, title=videotitle, url=url, + thumbnail=item.thumbnail, plot=item.plot, fulltitle=item.title, folder=False)) + + # Opción "Añadir esta película a la biblioteca de KODI" + if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos': + itemlist.append( + Item(channel=item.channel, + title='[COLOR yellow]Añadir esta pelicula a la videoteca[/COLOR]', + url=item.url, + action="add_pelicula_to_library", + extra="findvideos", + contentTitle=item.contentTitle, + thumbnail=item.thumbnail + )) + + return itemlist diff --git a/plugin.video.alfa/channels/mejortorrent1.py b/plugin.video.alfa/channels/mejortorrent1.py index cc9966c0..feffe91b 100644 --- a/plugin.video.alfa/channels/mejortorrent1.py +++ b/plugin.video.alfa/channels/mejortorrent1.py @@ -845,18 +845,21 @@ def findvideos(item): # Poner la calidad, si es necesario if not item_local.quality: + item_local.quality = '' if scrapertools.find_single_match(data, 'Formato:<\/b>&\w+;\s?([^<]+)
'): item_local.quality = scrapertools.find_single_match(data, 'Formato:<\/b>&\w+;\s?([^<]+)
') elif "hdtv" in item_local.url.lower() or "720p" in item_local.url.lower() or "1080p" in item_local.url.lower() or "4k" in item_local.url.lower(): item_local.quality = scrapertools.find_single_match(item_local.url, '.*?_([H|7|1|4].*?)\.torrent') item_local.quality = item_local.quality.replace("_", " ") - + # Extrae el tamaño del vídeo if scrapertools.find_single_match(data, 'Tama.*?:<\/b>&\w+;\s?([^<]+B)Tama.*?:<\/b>&\w+;\s?([^<]+B)
Size:<\/strong>?\s(\d+?\.?\d*?\s\w[b|B])<\/span>') size = size.replace(".", ",") #sustituimos . por , porque Unify lo borra if not size: - size = scrapertools.find_single_match(item.quality, '\s\[(\d+,?\d*?\s\w[b|B])\]') + size = scrapertools.find_single_match(item.quality, '\s\[(\d+,?\d*?\s\w\s?[b|B])\]') + if not size: + size = generictools.get_torrent_size(item.url) #Buscamos el tamaño en el .torrent if size: item.title = re.sub(r'\s\[\d+,?\d*?\s\w[b|B]\]', '', item.title) #Quitamos size de título, si lo traía item.title = '%s [%s]' % (item.title, size) #Agregamos size al final del título size = size.replace('GB', 'G B').replace('Gb', 'G b').replace('MB', 'M B').replace('Mb', 'M b') - item.quality = re.sub(r'\s\[\d+,?\d*?\s\w[b|B]\]', '', item.quality) #Quitamos size de calidad, si lo traía + item.quality = re.sub(r'\s\[\d+,?\d*?\s\w\s?[b|B]\]', '', item.quality) #Quitamos size de calidad, si lo traía #Llamamos al método para crear el título general del vídeo, con toda la información obtenida de TMDB item, itemlist = generictools.post_tmdb_findvideos(item, itemlist) @@ -1399,8 +1401,15 @@ def findvideos(item): else: quality = item_local.quality item_local.title = '[COLOR yellow][?][/COLOR] [COLOR yellow][Torrent][/COLOR] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (quality, str(item_local.language)) #Preparamos título de Torrent - item_local.title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title).strip() #Quitamos etiquetas vacías - item_local.title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', item_local.title).strip() #Quitamos colores vacíos + + #Preparamos título y calidad, quitamos etiquetas vacías + item_local.title = re.sub(r'\s?\[COLOR \w+\]\[\[?\s?\]?\]\[\/COLOR\]', '', item_local.title) + item_local.title = re.sub(r'\s?\[COLOR \w+\]\s?\[\/COLOR\]', '', item_local.title) + item_local.title = item_local.title.replace("--", "").replace("[]", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip() + quality = re.sub(r'\s?\[COLOR \w+\]\[\[?\s?\]?\]\[\/COLOR\]', '', quality) + quality = re.sub(r'\s?\[COLOR \w+\]\s?\[\/COLOR\]', '', quality) + quality = quality.replace("--", "").replace("[]", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip() + item_local.alive = "??" #Calidad del link sin verificar item_local.action = "play" #Visualizar vídeo item_local.server = "torrent" #Servidor @@ -1485,9 +1494,15 @@ def findvideos(item): item_local.action = "play" item_local.server = servidor item_local.url = enlace - item_local.title = item_local.title.replace("[]", "").strip() - item_local.title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title).strip() - item_local.title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', item_local.title).strip() + + #Preparamos título y calidad, quitamos etiquetas vacías + item_local.title = re.sub(r'\s?\[COLOR \w+\]\[\[?\s?\]?\]\[\/COLOR\]', '', item_local.title) + item_local.title = re.sub(r'\s?\[COLOR \w+\]\s?\[\/COLOR\]', '', item_local.title) + item_local.title = item_local.title.replace("--", "").replace("[]", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip() + item_local.quality = re.sub(r'\s?\[COLOR \w+\]\[\[?\s?\]?\]\[\/COLOR\]', '', item_local.quality) + item_local.quality = re.sub(r'\s?\[COLOR \w+\]\s?\[\/COLOR\]', '', item_local.quality) + item_local.quality = item_local.quality.replace("--", "").replace("[]", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip() + itemlist.append(item_local.clone()) except: @@ -1582,9 +1597,16 @@ def findvideos(item): item_local.action = "play" item_local.server = servidor item_local.url = enlace - item_local.title = parte_title.replace("[]", "").strip() - item_local.title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title).strip() - item_local.title = re.sub(r'\[COLOR \w+\]-\[\/COLOR\]', '', item_local.title).strip() + item_local.title = parte_title.strip() + + #Preparamos título y calidad, quitamos etiquetas vacías + item_local.title = re.sub(r'\s?\[COLOR \w+\]\[\[?\s?\]?\]\[\/COLOR\]', '', item_local.title) + item_local.title = re.sub(r'\s?\[COLOR \w+\]\s?\[\/COLOR\]', '', item_local.title) + item_local.title = item_local.title.replace("--", "").replace("[]", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip() + item_local.quality = re.sub(r'\s?\[COLOR \w+\]\[\[?\s?\]?\]\[\/COLOR\]', '', item_local.quality) + item_local.quality = re.sub(r'\s?\[COLOR \w+\]\s?\[\/COLOR\]', '', item_local.quality) + item_local.quality = item_local.quality.replace("--", "").replace("[]", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip() + itemlist.append(item_local.clone()) except: diff --git a/plugin.video.alfa/channels/peliculasgratis.py b/plugin.video.alfa/channels/peliculasgratis.py index ebc98e85..696ae554 100644 --- a/plugin.video.alfa/channels/peliculasgratis.py +++ b/plugin.video.alfa/channels/peliculasgratis.py @@ -89,6 +89,7 @@ def search(item, texto): logger.info() texto = texto.replace(" ", "+") item.url = host + "/search/%s" % texto + if item.contentType == '': item.contentType = 'movie' try: return scraper(item) # Se captura la excepción, para no interrumpir al buscador global si un canal falla diff --git a/plugin.video.alfa/channels/pelisipad.py b/plugin.video.alfa/channels/pelisipad.py old mode 100755 new mode 100644 index 3d317d76..63034e92 --- a/plugin.video.alfa/channels/pelisipad.py +++ b/plugin.video.alfa/channels/pelisipad.py @@ -519,6 +519,7 @@ def findvideos(item): if item.video_urls: import random import base64 + item.video_urls.sort(key=lambda it: (it[1], random.random()), reverse=True) i = 0 actual_quality = "" @@ -534,6 +535,7 @@ def findvideos(item): title += " [COLOR green]Mirror %s[/COLOR] - %s" % (str(i + 1), item.fulltitle) url = vid % "%s" % base64.b64decode("dHQ9MTQ4MDE5MDQ1MSZtbT1NRzZkclhFand6QmVzbmxSMHNZYXhBJmJiPUUwb1dVVVgx" "WTBCQTdhWENpeU9paUE=") + url += '|User-Agent=%s' % httptools.get_user_agent itemlist.append(item.clone(title=title, action="play", url=url, video_urls="")) i += 1 diff --git a/plugin.video.alfa/channels/pelisplusco.py b/plugin.video.alfa/channels/pelisplusco.py index 7b07366a..f02deda1 100644 --- a/plugin.video.alfa/channels/pelisplusco.py +++ b/plugin.video.alfa/channels/pelisplusco.py @@ -356,7 +356,7 @@ def get_links_by_language(item, data): patron = 'data-source=(.*?)data.*?srt=(.*?)data-iframe.*?Opci.*?<.*?hidden>[^\(]\((.*?)\)' matches = re.compile(patron, re.DOTALL).findall(data) if language in IDIOMAS: - language == IDIOMAS[language] + language = IDIOMAS[language] for url, sub, quality in matches: if 'http' not in url: @@ -403,7 +403,7 @@ def findvideos(item): i.quality) ) # Requerido para FilterTools - itemlist = filtertools.get_links(video_list, item, list_language) + video_list = filtertools.get_links(video_list, item, list_language) # Requerido para AutoPlay diff --git a/plugin.video.alfa/channels/search.py b/plugin.video.alfa/channels/search.py index 73e3498a..5daecf53 100644 --- a/plugin.video.alfa/channels/search.py +++ b/plugin.video.alfa/channels/search.py @@ -143,6 +143,85 @@ def settings(item): def setting_channel(item): + if config.get_platform(True)['num_version'] >= 17.0: # A partir de Kodi 16 se puede usar multiselect, y de 17 con preselect + return setting_channel_new(item) + else: + return setting_channel_old(item) + +def setting_channel_new(item): + import channelselector, xbmcgui + from core import channeltools + + # Cargar lista de opciones (canales activos del usuario y que permitan búsqueda global) + # ------------------------ + lista = []; ids = []; lista_lang = [] + channels_list = channelselector.filterchannels('all') + for channel in channels_list: + channel_parameters = channeltools.get_channel_parameters(channel.channel) + + # No incluir si en la configuracion del canal no existe "include_in_global_search" + if not channel_parameters['include_in_global_search']: + continue + + lbl = '%s' % channel_parameters['language'] + lbl += ' %s' % ', '.join(config.get_localized_category(categ) for categ in channel_parameters['categories']) + + it = xbmcgui.ListItem(channel.title, lbl) + it.setArt({ 'thumb': channel.thumbnail, 'fanart': channel.fanart }) + lista.append(it) + ids.append(channel.channel) + lista_lang.append(channel_parameters['language']) + + # Diálogo para pre-seleccionar + # ---------------------------- + preselecciones_std = ['Modificar selección actual', 'Modificar partiendo de Todos', 'Modificar partiendo de Ninguno', 'Modificar partiendo de Castellano', 'Modificar partiendo de Latino'] + if item.action == 'setting_channel': + # Configuración de los canales incluídos en la búsqueda + preselecciones = preselecciones_std + presel_values = [1, 2, 3, 4, 5] + else: + # Llamada desde "buscar en otros canales" (se puede saltar la selección e ir directo a la búsqueda) + preselecciones = ['Buscar con la selección actual'] + preselecciones_std + presel_values = [0, 1, 2, 3, 4, 5] + + ret = platformtools.dialog_select(config.get_localized_string(59994), preselecciones) + if ret == -1: return False # pedido cancel + if presel_values[ret] == 0: return True # continuar sin modificar + elif presel_values[ret] == 3: preselect = [] + elif presel_values[ret] == 2: preselect = range(len(ids)) + elif presel_values[ret] in [4, 5]: + busca = 'cast' if presel_values[ret] == 4 else 'lat' + preselect = [] + for i, lg in enumerate(lista_lang): + if busca in lg or '*' in lg: + preselect.append(i) + else: + preselect = [] + for i, canal in enumerate(ids): + channel_status = config.get_setting('include_in_global_search', canal) + if channel_status: + preselect.append(i) + + # Diálogo para seleccionar + # ------------------------ + ret = xbmcgui.Dialog().multiselect(config.get_localized_string(59994), lista, preselect=preselect, useDetails=True) + if ret == None: return False # pedido cancel + seleccionados = [ids[i] for i in ret] + + # Guardar cambios en canales para la búsqueda + # ------------------------------------------- + for canal in ids: + channel_status = config.get_setting('include_in_global_search', canal) + if channel_status is None: channel_status = True + + if channel_status and canal not in seleccionados: + config.set_setting('include_in_global_search', False, canal) + elif not channel_status and canal in seleccionados: + config.set_setting('include_in_global_search', True, canal) + + return True + +def setting_channel_old(item): channels_path = os.path.join(config.get_runtime_path(), "channels", '*.json') channel_language = config.get_setting("channel_language", default="all") @@ -204,6 +283,7 @@ def save_settings(item, dict_values): config.set_setting("include_in_global_search", dict_values[v], v) progreso.close() + return True def cb_custom_button(item, dict_values): @@ -354,8 +434,8 @@ def do_search(item, categories=None): categories = ["Películas"] setting_item = Item(channel=item.channel, title=config.get_localized_string(59994), folder=False, thumbnail=get_thumb("search.png")) - setting_channel(setting_item) - + if not setting_channel(setting_item): + return False if categories is None: categories = [] @@ -474,8 +554,8 @@ def do_search(item, categories=None): # es compatible tanto con versiones antiguas de python como nuevas if multithread: pendent = [a for a in threads if a.isAlive()] - t = float(100) / len(pendent) - while pendent: + if len(pendent) > 0: t = float(100) / len(pendent) + while len(pendent) > 0: index = (len(threads) - len(pendent)) + 1 percentage = int(math.ceil(index * t)) diff --git a/plugin.video.alfa/channels/tvvip.py b/plugin.video.alfa/channels/tvvip.py index 36b7ee4c..5045272a 100644 --- a/plugin.video.alfa/channels/tvvip.py +++ b/plugin.video.alfa/channels/tvvip.py @@ -620,7 +620,7 @@ def play(item): data['a']['tt']) + \ "&mm=" + data['a']['mm'] + "&bb=" + data['a']['bb'] - url += "|User-Agent=Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Mobile Safari/537.36" + url += "|User-Agent=%s" % httptools.get_user_agent itemlist.append(item.clone(action="play", server="directo", url=url, folder=False)) diff --git a/plugin.video.alfa/channels/ultrapeliculashd.json b/plugin.video.alfa/channels/ultrapeliculashd.json old mode 100755 new mode 100644 index 03c48a23..84ea556a --- a/plugin.video.alfa/channels/ultrapeliculashd.json +++ b/plugin.video.alfa/channels/ultrapeliculashd.json @@ -19,6 +19,20 @@ "enabled": true, "visible": true }, + { + "id": "filter_languages", + "type": "list", + "label": "Mostrar enlaces en idioma...", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "No filtrar", + "LAT", + "CAST", + "VOSE" + ] + }, { "id": "include_in_newest_latino", "type": "bool", diff --git a/plugin.video.alfa/channels/ultrapeliculashd.py b/plugin.video.alfa/channels/ultrapeliculashd.py index 8c98653b..b847f081 100644 --- a/plugin.video.alfa/channels/ultrapeliculashd.py +++ b/plugin.video.alfa/channels/ultrapeliculashd.py @@ -8,6 +8,7 @@ from core import servertools from core import jsontools from core import tmdb from core.item import Item +from channels import filtertools, autoplay from platformcode import config, logger host = 'http://www.ultrapeliculashd.com' @@ -63,39 +64,51 @@ tcalidad = {'1080P': 'https://s21.postimg.cc/4h1s0t1wn/hd1080.png', '720P': 'https://s12.postimg.cc/lthu7v4q5/hd720.png', "HD": "https://s27.postimg.cc/m2dhhkrur/image.png"} +IDIOMAS = {'Latino': 'LAT', 'Español': 'CAST', 'SUB':'VOSE'} +list_language = IDIOMAS.values() +list_quality = ['default', '1080p'] +list_servers = ['openload','directo'] + +__comprueba_enlaces__ = config.get_setting('comprueba_enlaces', 'ultrapeliculashd') +__comprueba_enlaces_num__ = config.get_setting('comprueba_enlaces_num', 'ultrapeliculashd') + def mainlist(item): logger.info() + autoplay.init(item.channel, list_servers, list_quality) + itemlist = [] - itemlist.append(item.clone(title="Todas", - action="lista", - thumbnail='https://s18.postimg.cc/fwvaeo6qh/todas.png', - fanart='https://s18.postimg.cc/fwvaeo6qh/todas.png', - url=host + '/movies/' - )) + itemlist.append(Item(channel=item.channel, title="Todas", + action="lista", + thumbnail='https://s18.postimg.cc/fwvaeo6qh/todas.png', + fanart='https://s18.postimg.cc/fwvaeo6qh/todas.png', + url=host + '/movies/' + )) - itemlist.append(item.clone(title="Generos", - action="generos", - url=host, - thumbnail='https://s3.postimg.cc/5s9jg2wtf/generos.png', - fanart='https://s3.postimg.cc/5s9jg2wtf/generos.png' - )) + itemlist.append(Item(channel=item.channel, title="Generos", + action="generos", + url=host, + thumbnail='https://s3.postimg.cc/5s9jg2wtf/generos.png', + fanart='https://s3.postimg.cc/5s9jg2wtf/generos.png' + )) - itemlist.append(item.clone(title="Alfabetico", - action="seccion", - url=host, - thumbnail='https://s17.postimg.cc/fwi1y99en/a-z.png', - fanart='https://s17.postimg.cc/fwi1y99en/a-z.png', - extra='alfabetico' - )) + itemlist.append(Item(channel=item.channel, title="Alfabetico", + action="seccion", + url=host, + thumbnail='https://s17.postimg.cc/fwi1y99en/a-z.png', + fanart='https://s17.postimg.cc/fwi1y99en/a-z.png', + extra='alfabetico' + )) - itemlist.append(item.clone(title="Buscar", - action="search", - url=host + '/?s=', - thumbnail='https://s30.postimg.cc/pei7txpa9/buscar.png', - fanart='https://s30.postimg.cc/pei7txpa9/buscar.png' - )) + itemlist.append(Item(channel=item.channel, title="Buscar", + action="search", + url=host + '/?s=', + thumbnail='https://s30.postimg.cc/pei7txpa9/buscar.png', + fanart='https://s30.postimg.cc/pei7txpa9/buscar.png' + )) + + autoplay.show_option(item.channel, itemlist) return itemlist @@ -160,13 +173,13 @@ def generos(item): title = scrapedtitle url = scrapedurl if scrapedtitle not in ['PRÓXIMAMENTE', 'EN CINE']: - itemlist.append(item.clone(action="lista", - title=title, - fulltitle=item.title, - url=url, - thumbnail=thumbnail, - fanart=fanart - )) + itemlist.append(Item(channel=item.channel, action="lista", + title=title, + fulltitle=item.title, + url=url, + thumbnail=thumbnail, + fanart=fanart + )) return itemlist @@ -209,15 +222,33 @@ def alpha(item): def findvideos(item): + from lib import jsunpack logger.info() itemlist = [] data = httptools.downloadpage(item.url).data data = re.sub(r'"|\n|\r|\t| |
|\s{2,}', "", data) - patron = '<\/iframe>' + patron = '
.*?-->(.*?)(?:\s|<)' % option) + if 'sub' in language.lower(): + language = 'SUB' + language = IDIOMAS[language] + if 'ultrapeliculashd' in video_url: + new_data = httptools.downloadpage(video_url).data + new_data = re.sub(r'"|\n|\r|\t| |
|\s{2,}', "", new_data) + if 'drive' not in video_url: + quality= '1080p' + packed = scrapertools.find_single_match(new_data, '