From 0655aca6166adfcdfc41cf0b313f196583063251 Mon Sep 17 00:00:00 2001 From: Kingbox <37674310+lopezvg@users.noreply.github.com> Date: Wed, 20 Jun 2018 16:11:54 +0200 Subject: [PATCH] =?UTF-8?q?GranTorrent=20y=20clones=20de=20NewPct1:=20adap?= =?UTF-8?q?taci=C3=B3n=20a=20GenericTools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Borrandos de código incorporado en GenericTools --- plugin.video.alfa/channels/descargas2020.py | 364 ++++-------------- plugin.video.alfa/channels/grantorrent.py | 255 ++---------- plugin.video.alfa/channels/mispelisyseries.py | 364 ++++-------------- plugin.video.alfa/channels/torrentlocura.py | 364 ++++-------------- plugin.video.alfa/channels/torrentrapid.py | 364 ++++-------------- plugin.video.alfa/channels/tumejortorrent.py | 364 ++++-------------- plugin.video.alfa/channels/tvsinpagar.py | 364 ++++-------------- 7 files changed, 436 insertions(+), 2003 deletions(-) diff --git a/plugin.video.alfa/channels/descargas2020.py b/plugin.video.alfa/channels/descargas2020.py index 23d388b9..01aed6bb 100644 --- a/plugin.video.alfa/channels/descargas2020.py +++ b/plugin.video.alfa/channels/descargas2020.py @@ -4,6 +4,7 @@ import re import sys import urllib import urlparse +import datetime from channelselector import get_thumb from core import httptools @@ -12,6 +13,7 @@ from core import servertools from core.item import Item from platformcode import config, logger from core import tmdb +from lib import generictools host = 'http://descargas2020.com/' @@ -145,11 +147,7 @@ def listado(item): clase = "pelilist" # etiqueta para localizar zona de listado de contenidos url_next_page ='' # Controlde paginación cnt_tot = 30 # Poner el num. máximo de items por página - category = "" # Guarda la categoria que viene desde una busqueda global - if item.category: - category = item.category - del item.category if item.totalItems: del item.totalItems @@ -258,8 +256,10 @@ def listado(item): del item_local.tipo if item_local.totalItems: del item_local.totalItems - if item.post_num: - del item.post_num + if item_local.post_num: + del item_local.post_num + if item_local.category: + del item_local.category item_local.title = '' item_local.context = "['buscar_trailer']" @@ -336,8 +336,8 @@ def listado(item): title_subs += ["[Miniserie]"] #Limpiamos restos en título - title = title.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "").replace("Espa", "").replace("Ingl", "").replace("Engl", "").replace("Calidad", "").replace("de la Serie", "") - title_alt = title_alt.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "").replace("Espa", "").replace("Ingl", "").replace("Engl", "").replace("Calidad", "").replace("de la Serie", "") + title = title.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "").replace("Ingl", "").replace("Engl", "").replace("Calidad", "").replace("de la Serie", "") + title_alt = title_alt.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "").replace("Ingl", "").replace("Engl", "").replace("Calidad", "").replace("de la Serie", "") #Limpiamos cabeceras y colas del título title = re.sub(r'Descargar\s\w+\-\w+', '', title) @@ -347,7 +347,7 @@ def listado(item): title = re.sub(r' \d+x\d+', '', title) title = re.sub(r' x\d+', '', title) - title = title.replace("Ver online ", "").replace("Descarga Serie HD ", "").replace("Descargar Serie HD ", "").replace("Descarga Serie ", "").replace("Descargar Serie ", "").replace("Ver en linea ", "").replace("Ver en linea", "").replace("HD ", "").replace("(Proper)", "").replace("RatDVD", "").replace("DVDRiP", "").replace("DVDRIP", "").replace("DVDR", "").replace("DVD9", "").replace("DVD", "").replace("DVB", "").replace("- ES ", "").replace("ES ", "").replace("COMPLETA", "").replace("(", "-").replace(")", "-").replace(".", " ").strip() + title = title.replace("Ver online ", "").replace("Descarga Serie HD ", "").replace("Descargar Serie HD ", "").replace("Descarga Serie ", "").replace("Descargar Serie ", "").replace("Ver en linea ", "").replace("Ver en linea", "").replace("HD ", "").replace("(Proper)", "").replace("RatDVD", "").replace("DVDRiP", "").replace("DVDRIP", "").replace("DVDRip", "").replace("DVDR", "").replace("DVD9", "").replace("DVD", "").replace("DVBRIP", "").replace("DVB", "").replace("LINE", "").replace("- ES ", "").replace("ES ", "").replace("COMPLETA", "").replace("(", "-").replace(")", "-").replace(".", " ").strip() title = title.replace("Descargar torrent ", "").replace("Descarga Gratis ", "").replace("Descargar Estreno ", "").replace("Descargar Estrenos ", "").replace("Pelicula en latino ", "").replace("Descargar Pelicula ", "").replace("Descargar Peliculas ", "").replace("Descargar peliculas ", "").replace("Descargar Todas ", "").replace("Descargar Otras ", "").replace("Descargar ", "").replace("Descarga ", "").replace("Bajar ", "").replace("HDRIP ", "").replace("HDRiP ", "").replace("HDRip ", "").replace("RIP ", "").replace("Rip", "").replace("RiP", "").replace("XviD", "").replace("AC3 5.1", "").replace("AC3", "").replace("1080p ", "").replace("720p ", "").replace("DVD-Screener ", "").replace("TS-Screener ", "").replace("Screener ", "").replace("BdRemux ", "").replace("BR ", "").replace("4KULTRA", "").replace("FULLBluRay", "").replace("FullBluRay", "").replace("BluRay", "").replace("Bonus Disc", "").replace("de Cine ", "").replace("TeleCine ", "").replace("latino", "").replace("Latino", "").replace("argentina", "").replace("Argentina", "").strip() @@ -403,65 +403,8 @@ def listado(item): #Pasamos a TMDB la lista completa Itemlist tmdb.set_infoLabels(itemlist, __modo_grafico__) - # Pasada para maquillaje de los títulos obtenidos desde TMDB - for item_local in itemlist: - title = item_local.title - - #Restauramos la info adicional guarda en la lista title_subs, y la borramos de Item - if len(item_local.title_subs) > 0: - title += " " - for title_subs in item_local.title_subs: - if "audio" in title_subs.lower(): - title = '%s [%s]' % (title, scrapertools.find_single_match(title_subs, r'[a|A]udio (.*?)')) - continue - if scrapertools.find_single_match(title_subs, r'(\d{4})'): - if not item_local.infoLabels['year'] or item_local.infoLabels['year'] == "-": - item_local.infoLabels['year'] = scrapertools.find_single_match(title_subs, r'(\d{4})') - continue - if not config.get_setting("unify"): #Si Titulos Inteligentes NO seleccionados: - title = '%s %s' % (title, title_subs) - else: - title = '%s -%s-' % (title, title_subs) - del item_local.title_subs - - # Si TMDB no ha encontrado el vídeo limpiamos el año - if item_local.infoLabels['year'] == "-": - item_local.infoLabels['year'] = '' - item_local.infoLabels['aired'] = '' - - # Preparamos el título para series, con los núm. de temporadas, si las hay - if item_local.contentType == "season" or item_local.contentType == "tvshow": - item_local.contentTitle= '' - - rating = '' - if item_local.infoLabels['rating'] and item_local.infoLabels['rating'] != '0.0': - rating = float(item_local.infoLabels['rating']) - rating = round(rating, 1) - - #Ahora maquillamos un poco los titulos dependiendo de si se han seleccionado títulos inteleigentes o no - if not config.get_setting("unify"): #Si Titulos Inteligentes NO seleccionados: - if item_local.contentType == "season" or item_local.contentType == "tvshow": - title = '%s [COLOR yellow][%s][/COLOR] [%s] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (title, scrapertools.find_single_match(str(item_local.infoLabels['aired']), r'\/(\d{4})'), rating, item_local.quality, str(item_local.language)) - - elif item_local.contentType == "movie": - title = '%s [COLOR yellow][%s][/COLOR] [%s] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (title, str(item_local.infoLabels['year']), rating, item_local.quality, str(item_local.language)) - - if config.get_setting("unify"): #Si Titulos Inteligentes SÍ seleccionados: - title = title.replace("[", "-").replace("]", "-") - - title = title.replace("--", "").replace(" []", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip() - title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', title).strip() - title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', title).strip() - - if category == "newest": #Viene de Novedades. Marquemos el título con el nombre del canal - title += ' -%s-' % item_local.channel.capitalize() - if item_local.contentType == "movie": - item_local.contentTitle += ' -%s-' % item_local.channel.capitalize() - - item_local.title = title - - logger.debug("url: " + item_local.url + " / title: " + item_local.title + " / content title: " + item_local.contentTitle + "/" + item_local.contentSerieName + " / calidad: " + item_local.quality + " / year: " + str(item_local.infoLabels['year'])) - #logger.debug(item_local) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) if len(itemlist) == 0: itemlist.append(Item(channel=item.channel, action="mainlist", title="No se ha podido cargar el listado")) @@ -728,7 +671,7 @@ def listado_busqueda(item): title_subs += ["[Miniserie]"] #Limpiamos restos en título - title = title.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "").replace("Esp", "").replace("Ing", "").replace("Eng", "").replace("Calidad", "").replace("de la Serie", "") + title = title.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "").replace("Ing", "").replace("Eng", "").replace("Calidad", "").replace("de la Serie", "") #Limpiamos cabeceras y colas del título title = re.sub(r'Descargar\s\w+\-\w+', '', title) @@ -738,7 +681,7 @@ def listado_busqueda(item): title = re.sub(r' \d+x\d+', '', title) title = re.sub(r' x\d+', '', title) - title = title.replace("Ver online ", "").replace("Descarga Serie HD ", "").replace("Descargar Serie HD ", "").replace("Descarga Serie ", "").replace("Descargar Serie ", "").replace("Ver en linea ", "").replace("Ver en linea", "").replace("HD ", "").replace("(Proper)", "").replace("RatDVD", "").replace("DVDRiP", "").replace("DVDRIP", "").replace("DVDR", "").replace("DVD9", "").replace("DVD", "").replace("DVB", "").replace("- ES ", "").replace("ES ", "").replace("COMPLETA", "").replace("(", "-").replace(")", "-").replace(".", " ").strip() + title = title.replace("Ver online ", "").replace("Descarga Serie HD ", "").replace("Descargar Serie HD ", "").replace("Descarga Serie ", "").replace("Descargar Serie ", "").replace("Ver en linea ", "").replace("Ver en linea", "").replace("HD ", "").replace("(Proper)", "").replace("RatDVD", "").replace("DVDRiP", "").replace("DVDRIP", "").replace("DVDRip", "").replace("DVDR", "").replace("DVD9", "").replace("DVD", "").replace("DVBRIP", "").replace("DVB", "").replace("LINE", "").replace("- ES ", "").replace("ES ", "").replace("COMPLETA", "").replace("(", "-").replace(")", "-").replace(".", " ").strip() title = title.replace("Descargar torrent ", "").replace("Descarga Gratis ", "").replace("Descargar Estreno ", "").replace("Descargar Estrenos ", "").replace("Pelicula en latino ", "").replace("Descargar Pelicula ", "").replace("Descargar Peliculas ", "").replace("Descargar peliculas ", "").replace("Descargar Todas ", "").replace("Descargar Otras ", "").replace("Descargar ", "").replace("Descarga ", "").replace("Bajar ", "").replace("HDRIP ", "").replace("HDRiP ", "").replace("HDRip ", "").replace("RIP ", "").replace("Rip", "").replace("RiP", "").replace("XviD", "").replace("AC3 5.1", "").replace("AC3", "").replace("1080p ", "").replace("720p ", "").replace("DVD-Screener ", "").replace("TS-Screener ", "").replace("Screener ", "").replace("BdRemux ", "").replace("BR ", "").replace("4KULTRA", "").replace("FULLBluRay", "").replace("FullBluRay", "").replace("BluRay", "").replace("Bonus Disc", "").replace("de Cine ", "").replace("TeleCine ", "").replace("latino", "").replace("Latino", "").replace("argentina", "").replace("Argentina", "").strip() @@ -868,64 +811,8 @@ def listado_busqueda(item): #Pasamos a TMDB la lista completa Itemlist tmdb.set_infoLabels(itemlist, __modo_grafico__) - # Pasada para maquillaje de los títulos obtenidos desde TMDB - for item_local in itemlist: - title = item_local.title - - #Restauramos la info adicional guarda en la lista title_subs, y la borramos de Item - if len(item_local.title_subs) > 0: - title += " " - for title_subs in item_local.title_subs: - if "audio" in title_subs.lower(): - title = '%s [%s]' % (title, scrapertools.find_single_match(title_subs, r'[a|A]udio (.*?)')) - continue - if scrapertools.find_single_match(title_subs, r'(\d{4})'): - if not item_local.infoLabels['year'] or item_local.infoLabels['year'] == "-": - item_local.infoLabels['year'] = scrapertools.find_single_match(title_subs, r'(\d{4})') - continue - if not config.get_setting("unify"): #Si Titulos Inteligentes NO seleccionados: - title = '%s %s' % (title, title_subs) - else: - title = '%s -%s-' % (title, title_subs) - del item_local.title_subs - - # Si TMDB no ha encontrado el vídeo limpiamos el año - if item_local.infoLabels['year'] == "-": - item_local.infoLabels['year'] = '' - item_local.infoLabels['aired'] = '' - - # Preparamos el título para series, con los núm. de temporadas, si las hay - if item_local.contentType == "season" or item_local.contentType == "tvshow": - item_local.contentTitle= '' - title += " -Serie-" - elif item_local.extra == "varios": - title += " -Varios-" - item_local.contentTitle += " -Varios-" - - rating = '' - if item_local.infoLabels['rating'] and item_local.infoLabels['rating'] != '0.0': - rating = float(item_local.infoLabels['rating']) - rating = round(rating, 1) - - #Ahora maquillamos un poco los titulos dependiendo de si se han seleccionado títulos inteleigentes o no - if not config.get_setting("unify"): #Si Titulos Inteligentes NO seleccionados: - if item_local.contentType == "season" or item_local.contentType == "tvshow": - title = '%s [COLOR yellow][%s][/COLOR] [%s] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (title, scrapertools.find_single_match(str(item_local.infoLabels['aired']), r'\/(\d{4})'), rating, item_local.quality, str(item_local.language)) - - elif item_local.contentType == "movie": - title = '%s [COLOR yellow][%s][/COLOR] [%s] [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]' % (title, str(item_local.infoLabels['year']), rating, item_local.quality, str(item_local.language)) - - if config.get_setting("unify"): #Si Titulos Inteligentes SÍ seleccionados: - title = title.replace("[", "-").replace("]", "-") - - title = title.replace("--", "").replace(" []", "").replace("()", "").replace("(/)", "").replace("[/]", "").strip() - title = re.sub(r'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', title).strip() - title = re.sub(r'\s\[COLOR \w+\]\[\/COLOR\]', '', title).strip() - item_local.title = title - - logger.debug("url: " + item_local.url + " / title: " + item_local.title + " / content title: " + item_local.contentTitle + "/" + item_local.contentSerieName + " / calidad: " + item_local.quality + "[" + str(item_local.language) + "]" + " / year: " + str(item_local.infoLabels['year'])) - - #logger.debug(item_local) + #Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB + item, itemlist = generictools.post_tmdb_listado(item, itemlist) if post: itemlist.append(item.clone(channel=item.channel, action="listado_busqueda", title="[COLOR gold][B]Pagina siguiente >> [/B][/COLOR]" + str(post_num) + " de " + str(total_pag), thumbnail=get_thumb("next.png"), title_lista=title_lista, cnt_pag=cnt_pag)) @@ -1042,32 +929,7 @@ def findvideos(item): verificar_enlaces_descargas = -1 #Verificar todos los enlaces Descargar verificar_enlaces_descargas_validos = True #"¿Contar sólo enlaces 'verificados' en Descargar?" excluir_enlaces_descargas = [] #Lista vacía de servidores excluidos en Descargar - - # Saber si estamos en una ventana emergente lanzada desde una viñeta del menú principal, - # con la función "play_from_library" - unify_status = False - try: - import xbmc - if xbmc.getCondVisibility('Window.IsMedia') == 1: - unify_status = config.get_setting("unify") - except: - unify_status = config.get_setting("unify") - #Salvamos la información de max num. de episodios por temporada para despues de TMDB - if item.infoLabels['temporada_num_episodios']: - num_episodios = item.infoLabels['temporada_num_episodios'] - else: - num_episodios = 1 - - # Obtener la información actualizada del Episodio, si no la hay - if not item.infoLabels['tmdb_id'] or (not item.infoLabels['episodio_titulo'] and item.contentType == 'episode'): - tmdb.set_infoLabels(item, __modo_grafico__) - elif (not item.infoLabels['tvdb_id'] and item.contentType == 'episode') or item.contentChannel == "videolibrary": - tmdb.set_infoLabels(item, __modo_grafico__) - #Restauramos la información de max num. de episodios por temporada despues de TMDB - if item.infoLabels['temporada_num_episodios'] and num_episodios > item.infoLabels['temporada_num_episodios']: - item.infoLabels['temporada_num_episodios'] = num_episodios - # Descarga la página try: data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data) @@ -1081,17 +943,15 @@ def findvideos(item): #Añadimos el tamaño para todos size = scrapertools.find_single_match(data, '