diff --git a/plugin.video.alfa/addon.xml b/plugin.video.alfa/addon.xml index b4686abb..bb14b150 100755 --- a/plugin.video.alfa/addon.xml +++ b/plugin.video.alfa/addon.xml @@ -1,5 +1,5 @@ - + @@ -18,13 +18,18 @@ resources/media/themes/ss/4.jpg [B]Estos son los cambios para esta versión:[/B] - [COLOR green][B]Canales agregados y arreglos[/B][/COLOR] - ¤ cinehindi ¤ repelis - ¤ rexpelis ¤ yape - ¤ bloghorror ¤ pelkex - ¤ documaniatv ¤ mejortorrent + [COLOR green][B]Arreglos[/B][/COLOR] + ¤ cinetux ¤ asialiveaction + ¤ dospelis ¤ pelisfox + ¤ pelisplus ¤ pelisplusco + ¤ poseidonhd ¤ yts - ¤ arreglos internos + [COLOR green][B]Novedades[/B][/COLOR] + ¤ peliculashd ¤ peliculonhd + ¤ tikiwiki ¤ vidcloud + ¤ dramasjc ¤ xms + + ¤Agradecimientos a @diegotcba y @wrlopez 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/asialiveaction.py b/plugin.video.alfa/channels/asialiveaction.py index b5ee5c26..60a79b4e 100644 --- a/plugin.video.alfa/channels/asialiveaction.py +++ b/plugin.video.alfa/channels/asialiveaction.py @@ -49,7 +49,7 @@ def category(item): data = scrapertools.find_single_match(data, 'Año.*?') elif item.cat == 'quality': data = scrapertools.find_single_match(data, 'Calidad.*?') - patron = "
  • ([^<]+)" + patron = "([^<]+)" matches = re.compile(patron, re.DOTALL).findall(data) for scrapedtitle, scrapedurl in matches: if scrapedtitle != 'Próximas Películas': @@ -82,8 +82,10 @@ def search_results(item): def search(item, texto): logger.info() + texto = texto.replace(" ", "+") item.url = item.url + texto + if texto != '': return search_results(item) @@ -113,40 +115,67 @@ def lista(item): logger.info() next = True itemlist = [] + data = httptools.downloadpage(item.url).data data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + + css_data = scrapertools.find_single_match(data, "") + data = scrapertools.find_single_match(data, "itemprop='headline'>.*?.*?") - patron = '.*?
    (\d{4})
    ' - patron += '
    (.*?)
    ([^<]+)
    ' + + patron = '.*?
    (.*?)' + patron += '(.*?)
    ([^<]+)
    ' matches = scrapertools.find_multiple_matches(data, patron) + first = int(item.first) last = first + 19 if last > len(matches): last = len(matches) next = False - for scrapedtype, scrapedyear, scrapedthumbnail, scrapedquality, scrapedtitle ,scrapedurl in matches[first:last]: - patron_quality="(.+?)" - quality = scrapertools.find_multiple_matches(scrapedquality, patron_quality) - qual="" - for calidad in quality: - qual=qual+"["+calidad+"] " - title="%s [%s] %s" % (scrapedtitle,scrapedyear,qual) - new_item= Item(channel=item.channel, title=title, url=host+scrapedurl, thumbnail=scrapedthumbnail, - type=scrapedtype, infoLabels={'year':scrapedyear}) + + for scrapedtype, scrapedyear, scrapedthumbnail, scrapedquality, scrapedtitle, scrapedurl in matches[first:last]: + year = scrapertools.find_single_match(scrapedyear, '(\d{4})') + + if not year: + class_year = scrapertools.find_single_match(scrapedyear, 'class="([^\"]+)"') + year = scrapertools.find_single_match(css_data, "\." + class_year + ":after {content:'(\d{4})';}") + if not year: + year = scrapertools.find_single_match(data, "headline'>(\d{4})") + + qual = "" + if scrapedquality: + patron_qualities='' + qualities = scrapertools.find_multiple_matches(scrapedquality, patron_qualities) + + for quality in qualities: + patron_desc = "\." + quality + ":after {content:'([^\']+)';}" + quality_desc = scrapertools.find_single_match(css_data, patron_desc) + + qual = qual+ "[" + quality_desc + "] " + + title="%s [%s] %s" % (scrapedtitle,year,qual) + + new_item = Item(channel=item.channel, title=title, url=host+scrapedurl, thumbnail=scrapedthumbnail, + type=scrapedtype, infoLabels={'year':year}) + if scrapedtype.strip() == 'sr': new_item.contentSerieName = scrapedtitle new_item.action = 'episodios' else: new_item.contentTitle = scrapedtitle new_item.action = 'findvideos' + if scrapedtype == item.type or item.type == 'cat': itemlist.append(new_item) + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + #pagination url_next_page = item.url first = last if next: itemlist.append(item.clone(title="Siguiente >>", url=url_next_page, action='lista', first=first)) + return itemlist diff --git a/plugin.video.alfa/channels/bloghorror.json b/plugin.video.alfa/channels/bloghorror.json index 23513828..e849f99d 100644 --- a/plugin.video.alfa/channels/bloghorror.json +++ b/plugin.video.alfa/channels/bloghorror.json @@ -3,8 +3,8 @@ "name": "BlogHorror", "active": true, "adult": false, - "language": [""], - "thumbnail": "", + "language": [], + "thumbnail": "https://i.postimg.cc/gcgQhKTL/2018-10-10_20_34_57-_Peliculas_de_Terror_BLOGHORROR.png", "banner": "", "categories": [ "movie", @@ -29,17 +29,9 @@ "visible": true }, { - "id": "include_in_newest_latino", + "id": "include_in_newest_torrent", "type": "bool", - "label": "Incluir en Novedades - Latino", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_infantiles", - "type": "bool", - "label": "Incluir en Novedades - Infantiles", + "label": "Incluir en Novedades - Torrent", "default": true, "enabled": true, "visible": true @@ -51,18 +43,6 @@ "default": true, "enabled": true, "visible": true - }, - { - "id": "filter_languages", - "type": "list", - "label": "Mostrar enlaces en idioma...", - "default": 0, - "enabled": true, - "visible": true, - "lvalues": [ - "No filtrar", - "LAT" - ] } ] } diff --git a/plugin.video.alfa/channels/cinetux.py b/plugin.video.alfa/channels/cinetux.py index 8776effd..fcb6cb67 100644 --- a/plugin.video.alfa/channels/cinetux.py +++ b/plugin.video.alfa/channels/cinetux.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- +import re from channels import autoplay from channels import filtertools from core import httptools @@ -231,6 +232,7 @@ def findvideos(item): data = httptools.downloadpage(item.url).data if filtro_enlaces != 0: list_enlaces = bloque_enlaces(data, filtro_idioma, dict_idiomas, "online", item) + return if list_enlaces: itemlist.append(item.clone(action="", title="Enlaces Online", text_color=color1, text_bold=True)) @@ -260,103 +262,159 @@ def findvideos(item): return itemlist -def bloque_enlaces(data, filtro_idioma, dict_idiomas, type, item): - logger.info() - lista_enlaces = [] - matches = [] - if type == "online": t_tipo = "Ver Online" - if type == "descarga": t_tipo = "Descargar" - data = data.replace("\n", "") - if type == "online": - patron = '(?is)class="playex.*?sheader' - bloque1 = scrapertools.find_single_match(data, patron) - patron = '(?is)#(option-[^"]+).*?png">([^<]+)' - match = scrapertools.find_multiple_matches(data, patron) - for scrapedoption, language in match: - scrapedserver = "" - lazy = "" - if "lazy" in bloque1: - lazy = "lazy-" - patron = '(?s)id="%s".*?metaframe.*?%ssrc="([^"]+)' % (scrapedoption, lazy) - url = scrapertools.find_single_match(bloque1, patron) - if "goo.gl" in url: - url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "") - if "drive.php" in url: - scrapedserver = "gvideo" - if "player" in url: - scrapedserver = scrapertools.find_single_match(url, 'player/(\w+)') - if "ok" in scrapedserver: scrapedserver = "okru" - matches.append([url, scrapedserver, "", language.strip(), t_tipo]) - bloque2 = scrapertools.find_single_match(data, '(?s)box_links.*?dt_social_single') - bloque2 = bloque2.replace("\t", "").replace("\r", "") - patron = '(?s)optn" href="([^"]+)' - patron += '.*?alt="([^\.]+)' - patron += '.*?src.*?src="[^>]+"?/>([^<]+)' - patron += '.*?src="[^>]+"?/>([^<]+)' - patron += '.*?/span>([^<]+)' - matches.extend(scrapertools.find_multiple_matches(bloque2, patron)) - filtrados = [] - for match in matches: - scrapedurl = match[0] - scrapedserver = match[1] - scrapedcalidad = match[2] - language = match[3] - scrapedtipo = match[4] - if t_tipo.upper() not in scrapedtipo.upper(): - continue - title = " Mirror en %s (" + language + ")" - if len(scrapedcalidad.strip()) > 0: - title += " (Calidad " + scrapedcalidad.strip() + ")" +# def bloque_enlaces(data, filtro_idioma, dict_idiomas, type, item): +# logger.info() +# lista_enlaces = [] +# matches = [] +# if type == "online": t_tipo = "Ver Online" +# if type == "descarga": t_tipo = "Descargar" +# data = data.replace("\n", "") +# if type == "online": +# patron = '(?is)class="playex.*?sheader' +# bloque1 = scrapertools.find_single_match(data, patron) +# patron = '(?is)#(option-[^"]+).*?png">([^<]+)' +# match = scrapertools.find_multiple_matches(data, patron) +# for scrapedoption, language in match: +# scrapedserver = "" +# lazy = "" +# if "lazy" in bloque1: +# lazy = "lazy-" +# patron = '(?s)id="%s".*?metaframe.*?%ssrc="([^"]+)' % (scrapedoption, lazy) +# url = scrapertools.find_single_match(bloque1, patron) +# if "goo.gl" in url: +# url = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers.get("location", "") +# if "drive.php" in url: +# scrapedserver = "gvideo" +# if "player" in url: +# scrapedserver = scrapertools.find_single_match(url, 'player/(\w+)') +# if "ok" in scrapedserver: scrapedserver = "okru" +# matches.append([url, scrapedserver, "", language.strip(), t_tipo]) +# bloque2 = scrapertools.find_single_match(data, '(?s)box_links.*?dt_social_single') +# bloque2 = bloque2.replace("\t", "").replace("\r", "") +# patron = '(?s)optn" href="([^"]+)' +# patron += '.*?alt="([^\.]+)' +# patron += '.*?src.*?src="[^>]+"?/>([^<]+)' +# patron += '.*?src="[^>]+"?/>([^<]+)' +# patron += '.*?/span>([^<]+)' +# matches.extend(scrapertools.find_multiple_matches(bloque2, patron)) +# filtrados = [] +# for match in matches: +# scrapedurl = match[0] +# scrapedserver = match[1] +# scrapedcalidad = match[2] +# language = match[3] +# scrapedtipo = match[4] +# if t_tipo.upper() not in scrapedtipo.upper(): +# continue +# title = " Mirror en %s (" + language + ")" +# if len(scrapedcalidad.strip()) > 0: +# title += " (Calidad " + scrapedcalidad.strip() + ")" +# +# if filtro_idioma == 3 or item.filtro: +# lista_enlaces.append(item.clone(title=title, action="play", text_color=color2, +# url=scrapedurl, server=scrapedserver, +# extra=item.url, contentThumbnail = item.thumbnail, +# language=language)) +# else: +# idioma = dict_idiomas[language] +# if idioma == filtro_idioma: +# lista_enlaces.append(item.clone(title=title, action="play", text_color=color2, +# url=scrapedurl, server=scrapedserver, +# extra=item.url, contentThumbnail = item.thumbnail, +# language=language)) +# else: +# if language not in filtrados: +# filtrados.append(language) +# lista_enlaces = servertools.get_servers_itemlist(lista_enlaces, lambda i: i.title % i.server.capitalize()) +# if filtro_idioma != 3: +# if len(filtrados) > 0: +# title = "Mostrar también enlaces filtrados en %s" % ", ".join(filtrados) +# lista_enlaces.append(item.clone(title=title, action="findvideos", url=item.url, text_color=color3, +# filtro=True)) +# return lista_enlaces +# +# +# def play(item): +# logger.info() +# itemlist = [] +# if "api.cinetux" in item.url or item.server == "okru" or "drive.php" in item.url or "youtube" in item.url: +# data = httptools.downloadpage(item.url, headers={'Referer': item.extra}).data.replace("\\", "") +# id = scrapertools.find_single_match(data, 'img src="[^#]+#(.*?)"') +# item.url = "http://docs.google.com/get_video_info?docid=" + id +# if item.server == "okru": +# item.url = "https://ok.ru/videoembed/" + id +# if item.server == "youtube": +# item.url = "https://www.youtube.com/embed/" + id +# elif "links" in item.url or "www.cinetux.me" in item.url: +# data = httptools.downloadpage(item.url).data +# scrapedurl = scrapertools.find_single_match(data, '|\s{2,}', "", data) + return data + +def findvideos(item): + import urllib + logger.info() + + itemlist=[] + + data = get_source(item.url) + + patron = 'class="title">([^>]+)
    .*?data-type="([^"]+)" data-post="(\d+)" data-nume="(\d+)' + matches = re.compile(patron, re.DOTALL).findall(data) + + for language, tp, pt, nm in matches: + + post = {'action':'doo_player_ajax', 'post':pt, 'nume':nm, 'type':tp} + post = urllib.urlencode(post) + new_data = httptools.downloadpage(CHANNEL_HOST+'wp-admin/admin-ajax.php', post=post, headers={'Referer':item.url}).data + if not config.get_setting('unify'): + if item.quality == '': + quality = 'SD' else: - if language not in filtrados: - filtrados.append(language) - lista_enlaces = servertools.get_servers_itemlist(lista_enlaces, lambda i: i.title % i.server.capitalize()) - if filtro_idioma != 3: - if len(filtrados) > 0: - title = "Mostrar también enlaces filtrados en %s" % ", ".join(filtrados) - lista_enlaces.append(item.clone(title=title, action="findvideos", url=item.url, text_color=color3, - filtro=True)) - return lista_enlaces + quality = item.quality + title = ' [%s][%s]' % (quality, IDIOMAS[language]) + else: + title = '' + url = scrapertools.find_single_match(new_data, "src='([^']+)'") + itemlist.append(Item(channel=item.channel, title ='%s'+title, url=url, action='play', quality=item.quality, + language=IDIOMAS[language], infoLabels=item.infoLabels)) + patron = "([^<]+)<" + matches = re.compile(patron, re.DOTALL).findall(data) -def play(item): - logger.info() - itemlist = [] - if "api.cinetux" in item.url or item.server == "okru" or "drive.php" in item.url or "youtube" in item.url: - data = httptools.downloadpage(item.url, headers={'Referer': item.extra}).data.replace("\\", "") - id = scrapertools.find_single_match(data, 'img src="[^#]+#(.*?)"') - item.url = "http://docs.google.com/get_video_info?docid=" + id - if item.server == "okru": - item.url = "https://ok.ru/videoembed/" + id - if item.server == "youtube": - item.url = "https://www.youtube.com/embed/" + id - elif "links" in item.url or "www.cinetux.me" in item.url: - data = httptools.downloadpage(item.url).data - scrapedurl = scrapertools.find_single_match(data, ')", "", httptools.downloadpage(item.url, timeout=timeout).data) - data = unicode(data, "utf-8", errors="replace").encode("utf-8") - except: - pass - - patron = '' - #Verificamos si se ha cargado una página, y si además tiene la estructura correcta - if not data or not scrapertools.find_single_match(data, patron): - item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada - if item.intervencion: #Sí ha sido clausurada judicialmente - for clone_inter, autoridad in item.intervencion: - thumb_intervenido = get_thumb(autoridad) - itemlist.append(item.clone(action='', title="[COLOR yellow]" + clone_inter.capitalize() + ': [/COLOR]' + intervenido_judicial + '. Reportar el problema en el foro', thumbnail=thumb_intervenido)) - return itemlist #Salimos - - logger.error("ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL: " + item.url + data) - if not data: #Si no ha logrado encontrar nada, salimos - itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: SUBMENU: La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - - matches = re.compile(patron, re.DOTALL).findall(data) - - if not matches: - logger.error("ERROR 02: SUBMENU: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) - itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: SUBMENU: Ha cambiado la estructura de la Web. Reportar el error con el log')) - return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos - - #logger.debug(matches) - - for scrapedurl, scrapedtitle in matches: - if 'series documentales' in scrapedtitle.lower(): - continue - itemlist.append(item.clone(action="listado", title=scrapedtitle.capitalize().strip(), url=scrapedurl)) - - return itemlist - - -def listado(item): - logger.info() - itemlist = [] - item.category = categoria - - #logger.debug(item) - - curr_page = 1 # Página inicial Web - curr_page_foot = 1 # Página inicial Alfa - last_page = 99999 # Última página inicial - last_page_foot = 1 # Última página inicial - cnt_tot = 40 # Poner el num. máximo de items por página - cnt_title = 0 # Contador de líneas insertadas en Itemlist - cnt_title_tot = 0 # Contador de líneas insertadas en Itemlist, total - if item.curr_page: - curr_page = int(item.curr_page) # Si viene de una pasada anterior, lo usamos - del item.curr_page # ... y lo borramos - if item.curr_page_foot: - curr_page_foot = int(item.curr_page_foot) # Si viene de una pasada anterior, lo usamos - del item.curr_page_foot # ... y lo borramos - if item.last_page: - last_page = int(item.last_page) # Si viene de una pasada anterior, lo usamos - del item.last_page # ... y lo borramos - if item.last_page_foot: - last_page_foot = int(item.last_page_foot) # Si viene de una pasada anterior, lo usamos - del item.last_page_foot # ... y lo borramos - if item.cnt_tot: - cnt_tot = int(item.cnt_tot) # Si viene de una pasada anterior, lo usamos - del item.cnt_tot # ... y lo borramos - if item.cnt_title_tot: - cnt_title_tot = int(item.cnt_title_tot) # Si viene de una pasada anterior, lo usamos - del item.cnt_title_tot # ... y lo borramos - - inicio = time.time() # Controlaremos que el proceso no exceda de un tiempo razonable - fin = inicio + 10 # Después de este tiempo pintamos (segundos) - timeout_search = timeout # Timeout para descargas - if item.extra == 'search': - timeout_search = timeout * 2 # Timeout un poco más largo para las búsquedas - if timeout_search < 5: - timeout_search = 5 # Timeout un poco más largo para las búsquedas - - if not item.extra2: # Si viene de Catálogo o de Alfabeto - item.extra2 = '' - - next_page_url = item.url - #Máximo num. de líneas permitidas por TMDB. Máx de 10 segundos por Itemlist para no degradar el rendimiento - while cnt_title < cnt_tot and curr_page <= last_page and fin > time.time(): - - # Descarga la página - data = '' - try: - data = re.sub(r"\n|\r|\t|\s{2}|()| ", "", httptools.downloadpage(next_page_url, timeout=timeout_search).data) - data = unicode(data, "utf-8", errors="replace").encode("utf-8") - except: - pass - - if not data: #Si la web está caída salimos sin dar error - logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + data) - itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) - break #si no hay más datos, algo no funciona, pintamos lo que tenemos - - #Patrón para todo, menos para Series - patron = '(.*?)<\/span>.*?.*?data-echo="([^"]+)"' - - #Si viene de Series, ponemos un patrón especializado - if item.extra == 'series': - patron = '(?:(.*?)<\/span>.*?)?.*? cnt_title_tot and cnt_title_tot > 0: - matches = matches[cnt_title_tot:] - - #logger.debug("PATRON: " + patron) - #logger.debug(matches) - #logger.debug(data) - - #Buscamos la url de paginado y la última página - data_page = scrapertools.find_single_match(data, '') + elif 'Año' in item.title: + data = scrapertools.find_single_match(full_data, '

    Busqueda por Año

    (.*?)') + patron = '([^<]+)<' + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedtitle in matches: + title = scrapedtitle + plot='' + title = scrapedtitle + url = scrapedurl + if title not in duplicados and title.lower() != 'proximamente': + itemlist.append(Item(channel=item.channel, url=url, title=title, plot=plot, action='list_all', + type=item.type)) + duplicados.append(title) + + return itemlist + +def list_all(item): + logger.info() + itemlist = [] + + data = get_source(item.url) + if item.type == 'movies': + patron = '
    \s?([^.*?' + patron += '"quality">([^<]+)<\/div>\s?.*?.*?([^<]+)