NewPct1: clon Planetatorrent añadido
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
"name": "Newpct1",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["*"],
|
||||
"language": ["cast", "lat"],
|
||||
"thumbnail": "newpct1.png",
|
||||
"banner": "newpct1.png",
|
||||
"categories": [
|
||||
@@ -44,6 +44,7 @@
|
||||
"Tumejortorrent",
|
||||
"Torrentlocura",
|
||||
"Tvsinpagar",
|
||||
"Planetatorrent",
|
||||
"Descargas2020",
|
||||
"Mispelisyseries"
|
||||
]
|
||||
@@ -52,7 +53,7 @@
|
||||
"id": "clonenewpct1_channels_list",
|
||||
"type": "text",
|
||||
"label": "Lista de clones de NewPct1 y orden de uso",
|
||||
"default": "('1', 'torrentrapid', 'http://torrentrapid.com/', 'movie, tvshow, season, episode', 'serie_episodios'), ('1', 'tumejortorrent', 'http://tumejortorrent.com/', 'movie, tvshow, season, episode', ''), ('1', 'torrentlocura', 'http://torrentlocura.com/', 'movie, tvshow, season, episode', ''), ('1', 'tvsinpagar', 'http://www.tvsinpagar.com/', 'tvshow, season, episode', ''), ('1', 'descargas2020', 'http://descargas2020.com/', 'movie, tvshow, season, episode', ''), ('1', 'mispelisyseries', 'http://mispelisyseries.com/', 'movie', 'search, listado_busqueda')",
|
||||
"default": "('1', 'torrentrapid', 'http://torrentrapid.com/', 'movie, tvshow, season, episode', 'serie_episodios'), ('1', 'tumejortorrent', 'http://tumejortorrent.com/', 'movie, tvshow, season, episode', ''), ('1', 'torrentlocura', 'http://torrentlocura.com/', 'movie, tvshow, season, episode', ''), ('1', 'tvsinpagar', 'http://www.tvsinpagar.com/', 'tvshow, season, episode', ''), ('1', 'planetatorrent', 'http://planetatorrent.com/', 'movie, tvshow, season, episode', ''), ('1', 'descargas2020', 'http://descargas2020.com/', 'movie, tvshow, season, episode', ''), ('1', 'mispelisyseries', 'http://mispelisyseries.com/', 'movie', 'search, listado_busqueda')",
|
||||
"enabled": true,
|
||||
"visible": false
|
||||
},
|
||||
@@ -60,7 +61,7 @@
|
||||
"id": "intervenidos_channels_list",
|
||||
"type": "text",
|
||||
"label": "Lista de canales y clones de NewPct1 intervenidos y orden de sustitución de URLs",
|
||||
"default": "('0', 'canal_org', 'canal_des', 'url_org', 'url_des', 'patron1', 'patron2', 'patron3', 'patron4', 'patron5', 'content_inc', 'content_exc', 'ow_force'), ('1', 'mejortorrent', 'mejortorrent1', 'http://www.mejortorrent.com/', 'https://mejortorrent1.com/', '(http.?:\/\/.*?\/)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)([^0-9]+-)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-\\d+-(Temporada-).html', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-(\\d+)-', '', 'tvshow, season', '', 'force'), ('1', 'mejortorrent', 'mejortorrent1', 'http://www.mejortorrent.com/', 'https://mejortorrent1.com/', '(http.?:\/\/.*?\/)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-([^.]+).html', '', '', '', 'movie', '', 'force'), ('1', 'newpct1', '', '', '', '', '', '', '', '', '*', '', 'del'), ('1', 'videolibrary', '', '', '', '', '', '', '', '', '*', '', 'del')",
|
||||
"default": "('0', 'canal_org', 'canal_des', 'url_org', 'url_des', 'patron1', 'patron2', 'patron3', 'patron4', 'patron5', 'content_inc', 'content_exc', 'ow_force'), ('1', 'mejortorrent', 'mejortorrent1', 'http://www.mejortorrent.com/', 'https://mejortorrent1.com/', '(http.?:\/\/.*?\/)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)([^0-9]+-)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-\\d+-(Temporada-).html', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-(?:[^-]+-)[^0-9]+-(\\d+)-', '', 'tvshow, season', '', 'force'), ('1', 'mejortorrent', 'mejortorrent1', 'http://www.mejortorrent.com/', 'https://mejortorrent1.com/', '(http.?:\/\/.*?\/)', 'http.?:\/\/.*?\/.*?-torrent.?-[^-]+-([^.]+).html', '', '', '', 'movie', '', 'force')",
|
||||
"enabled": true,
|
||||
"visible": false
|
||||
},
|
||||
|
||||
@@ -64,7 +64,7 @@ episodio_serie = config.get_setting('clonenewpct1_serie_episodio_novedades', cha
|
||||
#Temporal, sólo para actualizar newpct1_data.json con otro valor por defecto
|
||||
#channel_banned = config.get_setting('clonenewpct1_excluir1_enlaces_veronline', channel_py) #1eer Canal baneado
|
||||
#if channel_banned == 9:
|
||||
# config.set_setting('clonenewpct1_excluir1_enlaces_veronline', 22, channel_py) #se pone el nuevo valor por defecto
|
||||
# config.set_setting('clonenewpct1_excluir1_enlaces_veronline', 22, channel_py) #se pone el nuevo valor por defecto
|
||||
|
||||
|
||||
def mainlist(item):
|
||||
@@ -148,7 +148,7 @@ def submenu(item):
|
||||
if not data: #Si no ha logrado encontrar nada, salimos
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR]: Ningún canal NewPct1 activo'))
|
||||
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
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
elif item.channel_alt: #Si ha habido fail-over, lo comento
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR] [ALT ] en uso'))
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel_alt.capitalize() + '[/COLOR] inaccesible'))
|
||||
@@ -161,11 +161,11 @@ def submenu(item):
|
||||
if "pelisyseries.com" in item.channel_host and item.extra == "varios": #compatibilidad con mispelisy.series.com
|
||||
data = '<li><a href="' + item.channel_host + 'varios/" title="Documentales">Documentales</a></li>'
|
||||
else:
|
||||
data = scrapertools.get_match(data, patron) #Seleccionamos el trozo que nos interesa
|
||||
data = scrapertools.get_match(data, patron) #Seleccionamos el trozo que nos interesa
|
||||
if not data:
|
||||
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
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
|
||||
patron = '<li><a.*?href="([^"]+)"\s?.itle="[^"]+"\s?>([^>]+)<\/a><\/li>'
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
@@ -173,7 +173,7 @@ def submenu(item):
|
||||
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
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
|
||||
for scrapedurl, scrapedtitle in matches:
|
||||
title = scrapedtitle.strip()
|
||||
@@ -208,7 +208,7 @@ def submenu_novedades(item):
|
||||
|
||||
if channel_clone_name == "*** DOWN ***": #Ningún clones activo !!!
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]Ningún canal NewPct1 activo[/COLOR]"))
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos
|
||||
|
||||
try:
|
||||
data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(item.url, timeout=timeout_search).data)
|
||||
@@ -232,7 +232,7 @@ def submenu_novedades(item):
|
||||
if not data: #Si no ha logrado encontrar nada, salimos
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR]: Ningún canal NewPct1 activo'))
|
||||
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
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
elif item.channel_alt: #Si ha habido fail-over, lo comento
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR] [ALT ] en uso'))
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel_alt.capitalize() + '[/COLOR] inaccesible'))
|
||||
@@ -307,7 +307,7 @@ def alfabeto(item):
|
||||
if not data: #Si no ha logrado encontrar nada, salimos
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR]: Ningún canal NewPct1 activo'))
|
||||
itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: ALFABETO: 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
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
elif item.channel_alt: #Si ha habido fail-over, lo comento
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.category + '[/COLOR] [ALT ] en uso'))
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel_alt.capitalize() + '[/COLOR] inaccesible'))
|
||||
@@ -323,7 +323,7 @@ def alfabeto(item):
|
||||
if not matches:
|
||||
logger.error("ERROR 02: ALFABETO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data)
|
||||
itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: ALFABETO: 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
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
|
||||
for scrapedurl, scrapedtitle in matches:
|
||||
title = scrapedtitle.upper()
|
||||
@@ -336,9 +336,9 @@ def alfabeto(item):
|
||||
def listado(item):
|
||||
logger.info()
|
||||
itemlist = []
|
||||
clase = "pelilist" # etiqueta para localizar zona de listado de contenidos
|
||||
url_next_page ='' # Control de paginación
|
||||
cnt_tot = 30 # Poner el num. máximo de items por página
|
||||
clase = "pelilist" # etiqueta para localizar zona de listado de contenidos
|
||||
url_next_page ='' # Control de paginación
|
||||
cnt_tot = 30 # Poner el num. máximo de items por página
|
||||
|
||||
if item.totalItems:
|
||||
del item.totalItems
|
||||
@@ -363,7 +363,7 @@ def listado(item):
|
||||
if not data: #Si no ha logrado encontrar nada, salimos
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo'))
|
||||
itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: LISTADO: 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
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
|
||||
#Establecemos los valores básicos en función del tipo de contenido
|
||||
if item.extra == "peliculas":
|
||||
@@ -387,7 +387,7 @@ def listado(item):
|
||||
if not fichas and not '<h3><strong>( 0 ) Resultados encontrados </strong>' in data: #error
|
||||
logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data)
|
||||
itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: LISTADO: 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
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
elif '<h3><strong>( 0 ) Resultados encontrados </strong>' in data: #no hay vídeos
|
||||
return itemlist
|
||||
else:
|
||||
@@ -395,16 +395,16 @@ def listado(item):
|
||||
page_extra = clase
|
||||
|
||||
#Scrapea los datos de cada vídeo. Título alternativo se mantiene, aunque no se usa de momento
|
||||
patron = '<a href="([^"]+).*?' # la url
|
||||
patron += 'title="([^"]+).*?' # el titulo
|
||||
patron += '<img.*?src="([^"]+)"[^>]+>.*?' # el thumbnail
|
||||
patron += '<h2.*?>(.*?)?<\/h2>' # titulo alternativo. Se trunca en títulos largos
|
||||
patron += '<span>([^<].*?)?<' # la calidad
|
||||
patron = '<a href="([^"]+).*?' # la url
|
||||
patron += 'title="([^"]+).*?' # el titulo
|
||||
patron += '<img.*?src="([^"]+)"[^>]+>.*?' # el thumbnail
|
||||
patron += '<h2.*?>(.*?)?<\/h2>' # titulo alternativo. Se trunca en títulos largos
|
||||
patron += '<span>([^<].*?)?<' # la calidad
|
||||
matches = re.compile(patron, re.DOTALL).findall(fichas)
|
||||
if not matches: #error
|
||||
logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + fichas)
|
||||
itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: LISTADO: 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
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
|
||||
#logger.debug("MATCHES: " + str(len(matches)))
|
||||
#logger.debug(matches)
|
||||
@@ -513,16 +513,18 @@ def listado(item):
|
||||
title = title.replace("(2D)", "").replace("(2d)", "").replace("2D", "").replace("2d", "")
|
||||
title_subs += ["[2D]"]
|
||||
|
||||
#Extraemos info adicional del título y la guardamos para después de TMDB
|
||||
if "temp" in title.lower() or "cap" in title.lower(): #Eliminamos Temporada, solo nos interesa la serie completa
|
||||
title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title)
|
||||
title = re.sub(r' - [t|T]emp\w+ \d+x\d+', '', title)
|
||||
title = re.sub(r' - [t|T]emp\w+ \d+', '', title)
|
||||
title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title)
|
||||
title = re.sub(r' [t|T]emp.*?\d+x\d+', '', title)
|
||||
if ("temp" in title.lower() or "cap" in title.lower()) and item_local.contentType != "movie":
|
||||
#Eliminamos Temporada de Series, solo nos interesa la serie completa
|
||||
title = re.sub(r'-? [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title)
|
||||
title = re.sub(r'-? [t|T]emp\w+.?\d+.?[c|C]ap\w+.?\d+.?(?:al|Al|y).?\d+', '', title)
|
||||
title = re.sub(r'-? [t|T]emp\w+ \d+x\d+', '', title)
|
||||
title = re.sub(r'-? [t|T]emp\w+ \d+', '', title)
|
||||
title = re.sub(r'-? [t|T]emp\w+.*?\d+', '', title)
|
||||
title = re.sub(r' [t|T]emp.*?\d+[x|X]\d+', '', title)
|
||||
title = re.sub(r' [t|T]emp.*?\d+', '', title)
|
||||
title = re.sub(r' [c|C]ap.*?\d+ al \d+', '', title)
|
||||
title = re.sub(r' [c|C]ap.*?\d+', '', title)
|
||||
if "audio" in title.lower(): #Reservamos info de audio para después de TMDB
|
||||
if "audio" in title.lower(): #Reservamos info de audio para después de TMDB
|
||||
title_subs += ['[%s]' % scrapertools.find_single_match(title, r'(\[[a|A]udio.*?\])')]
|
||||
title = re.sub(r'\[[a|A]udio.*?\]', '', title)
|
||||
if "[dual" in title.lower() or "multileng" in title.lower() or "multileng" in item_local.quality.lower() or (("espa" in title.lower() or "spani" in title.lower()) and "VOS" in item_local.language):
|
||||
@@ -536,9 +538,9 @@ def listado(item):
|
||||
if "trilog" in title.lower():
|
||||
title_subs += ["[Saga]"]
|
||||
title = title.replace(" Trilogia", "").replace(" trilogia", "").replace(" Trilog", "").replace(" trilog", "")
|
||||
if "extendida" in title.lower():
|
||||
if "extendida" in title.lower() or "v.e." in title.lower()or "v e " in title.lower():
|
||||
title_subs += ["[V. Extendida]"]
|
||||
title = title.replace(" Version Extendida", "").replace(" (Version Extendida)", "").replace(" V. Extendida", "").replace(" VExtendida", "").replace(" V Extendida", "")
|
||||
title = title.replace("Version Extendida", "").replace("(Version Extendida)", "").replace("V. Extendida", "").replace("VExtendida", "").replace("V Extendida", "").replace("V.Extendida", "").replace("V Extendida", "").replace("V.E.", "").replace("V E ", "")
|
||||
if "saga" in title.lower():
|
||||
title = title.replace(" Saga Completa", "").replace(" saga sompleta", "").replace(" Saga", "").replace(" saga", "")
|
||||
title_subs += ["[Saga]"]
|
||||
@@ -549,21 +551,22 @@ 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("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", "")
|
||||
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", "").replace("Spanish", "")
|
||||
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", "").replace("Spanish", "")
|
||||
|
||||
#Limpiamos cabeceras y colas del título
|
||||
title = re.sub(r'Descargar\s\w+\-\w+', '', title)
|
||||
title = re.sub(r'\(COMPLE.*?\)', '', title)
|
||||
|
||||
title = title.replace("Ver online Serie", "").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("en Full HD", "").replace("en hd ", "").replace("en HD ", "").replace("MicroHD", "").replace("HD ", "").replace("(Proper)", "").replace("HDTV", "").replace("RatDVD", "").replace("DVDRiP", "").replace("DVDRIP", "").replace("DVDRip", "").replace("DVDR", "").replace("DVD9", "").replace("DVD", "").replace("DVBRIP", "").replace("DVB", "").replace("LINE", "").replace("calidad", " ").replace("- ES ", "").replace("ES ", "").replace("COMPLETA", "").replace("Serie Animada", " ").replace("(", "-").replace(")", "-").replace(".", " ").strip()
|
||||
|
||||
title = title.replace("Descargar torrent ", "").replace("Descarga Gratis", "").replace("Descarga gratis", "").replace("Descargar Gratis", "").replace("Descargar gratis", "").replace("en gratis", "").replace("gratis gratis", "").replace("Gratisgratis", "").replace("Descargar Estreno ", "").replace("Descargar Estrenos ", "").replace("Pelicula en latino ", "").replace("Descargar Pelicula ", "").replace("Descargar pelicula ", "").replace("Descargar Peliculas ", "").replace("Descargar peliculas ", "").replace("Descargar Todas ", "").replace("Descargar Otras ", "").replace("Descargar ", "").replace("Descarga ", "").replace("Descargar ", "").replace("Decargar ", "").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("4K UHDrip", "").replace("BDremux", "").replace("FULL UHD4K", "").replace("4KULTRA", "").replace("FULLBluRay", "").replace("FullBluRay", "").replace("en BluRay", "").replace("BluRay en", "").replace("Bluray en", "").replace("BluRay", "").replace("Bonus Disc", "").replace("de Cine ", "").replace("TeleCine ", "").replace("latino", "").replace("Latino", "").replace("argentina", "").replace("Argentina", "").replace("++Sub", "").replace("+-+Sub", "").strip()
|
||||
|
||||
title = re.sub(r'\(\d{4}\)$', '', title)
|
||||
if re.sub(r'\d{4}$', '', title).strip():
|
||||
title = re.sub(r'\d{4}$', '', title)
|
||||
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("en Full HD", "").replace("en hd ", "").replace("en HD ", "").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("calidad", " ").replace("- ES ", "").replace("ES ", "").replace("COMPLETA", "").replace("(", "-").replace(")", "-").replace(".", " ").strip()
|
||||
|
||||
title = title.replace("Descargar torrent ", "").replace("Descarga Gratis", "").replace("Descarga gratis", "").replace("Descargar Gratis", "").replace("Descargar gratis", "").replace("en gratis", "").replace("gratis gratis", "").replace("Gratisgratis", "").replace("Descargar Estreno ", "").replace("Descargar Estrenos ", "").replace("Pelicula en latino ", "").replace("Descargar Pelicula ", "").replace("Descargar pelicula ", "").replace("Descargar Peliculas ", "").replace("Descargar peliculas ", "").replace("Descargar Todas ", "").replace("Descargar Otras ", "").replace("Descargar ", "").replace("Descarga ", "").replace("Descargar ", "").replace("Decargar ", "").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("en BluRay", "").replace("BluRay en", "").replace("Bluray en", "").replace("BluRay", "").replace("Bonus Disc", "").replace("de Cine ", "").replace("TeleCine ", "").replace("latino", "").replace("Latino", "").replace("argentina", "").replace("Argentina", "").replace("++Sub", "").replace("+-+Sub", "").strip()
|
||||
title = re.sub(r'\d+x\d+', '', title)
|
||||
title = re.sub(r'x\d+', '', title).strip()
|
||||
|
||||
if title.endswith("torrent gratis"): title = title[:-15]
|
||||
if title.endswith("gratis"): title = title[:-7]
|
||||
@@ -590,7 +593,7 @@ def listado(item):
|
||||
#Limpieza final del título y guardado en las variables según su tipo de contenido
|
||||
title = scrapertools.remove_htmltags(title)
|
||||
item_local.title = title
|
||||
item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título
|
||||
item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título
|
||||
if item_local.contentType == "movie":
|
||||
item_local.contentTitle = title
|
||||
else:
|
||||
@@ -649,10 +652,10 @@ def listado_busqueda(item):
|
||||
|
||||
if channel_clone_name == "*** DOWN ***": #Ningún clones activo !!!
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]Ningún canal NewPct1 activo[/COLOR]"))
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos y salimos
|
||||
|
||||
itemlist = []
|
||||
cnt_tot = 40 # Poner el num. máximo de items por página. Dejamos que la web lo controle
|
||||
cnt_tot = 40 # Poner el num. máximo de items por página. Dejamos que la web lo controle
|
||||
cnt_title = 0 # Contador de líneas insertadas en Itemlist
|
||||
cnt_pag = 0 # Contador de líneas leídas de Matches
|
||||
timeout_search = timeout * 2 # Timeout un poco más largo para las búsquedas
|
||||
@@ -671,8 +674,8 @@ def listado_busqueda(item):
|
||||
del item.text_color
|
||||
|
||||
#Sistema de paginado para evitar páginas vacías o semi-vacías en casos de búsquedas con series con muchos episodios
|
||||
title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas
|
||||
if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada
|
||||
title_lista = [] # Guarda la lista de series que ya están en Itemlist, para no duplicar lineas
|
||||
if item.title_lista: # Si viene de una pasada anterior, la lista ya estará guardada
|
||||
title_lista = item.title_lista # Se usa la lista de páginas anteriores en Item
|
||||
title_lista_alt = []
|
||||
for url in title_lista:
|
||||
@@ -692,10 +695,11 @@ def listado_busqueda(item):
|
||||
pass
|
||||
|
||||
cnt_next += 1
|
||||
#seleccionamos el bloque que nos interesa
|
||||
if item.extra == "novedades":
|
||||
pattern = '<div class="content">.*?<ul class="noticias(.*?)<\/div><!-- end .content -->' #seleccionamos el bloque que nos interesa
|
||||
pattern = '<div class="content">.*?<ul class="noticias(.*?)<\/div><!-- end .content -->'
|
||||
else:
|
||||
pattern = '<ul class="%s">(.*?)</ul>' % item.pattern #seleccionamos el bloque que nos interesa
|
||||
pattern = '<ul class="%s">(.*?)</ul>' % item.pattern
|
||||
if not data or (not scrapertools.find_single_match(data, pattern) and not '<h3><strong>( 0 ) Resultados encontrados </strong>' in data):
|
||||
item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada
|
||||
if item.intervencion: #Sí ha sido clausurada judicialmente
|
||||
@@ -709,34 +713,40 @@ def listado_busqueda(item):
|
||||
if not data: #Si no ha logrado encontrar nada, salimos
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo'))
|
||||
itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: LISTADO_BUSQUEDA:. 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
|
||||
elif item.channel_alt: #Si ha habido fail-over, lo comento
|
||||
if len(itemlist) > 2:
|
||||
#Pasamos a TMDB la lista completa Itemlist
|
||||
tmdb.set_infoLabels(itemlist, __modo_grafico__)
|
||||
#Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB
|
||||
item, itemlist = generictools.post_tmdb_listado(item, itemlist)
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
elif item.channel_alt: #Si ha habido fail-over, lo comento
|
||||
host = host.replace(item.channel_alt, item.channel)
|
||||
|
||||
#Obtiene la dirección de la próxima página, si la hay
|
||||
try:
|
||||
post_actual = item.post #Guardamos el post actual por si hay overflow de Itemlist y hay que hechar marcha atrás
|
||||
|
||||
if item.extra == "novedades":
|
||||
get, post, total_pag = scrapertools.find_single_match(data, '<ul class="pagination">.*?<a\s*href="([^"]+pg\/)(\d+)">Next<\/a>.*?<a\s*href="[^"]+pg\/(\d+)">Last<\/a>')
|
||||
post_actual = item.post #Guardamos el post actual por si hay overflow de Itemlist y hay que hechar marcha atrás
|
||||
#Probamos si es Novedades o Planetatorrent, sino, el resto
|
||||
if scrapertools.find_single_match(data, '<ul class="pagination">.*?<a\s*href="([^"]+pg[\/|=])(\d+)">Next<\/a>.*?<a\s*href="[^"]+pg[\/|=](\d+)">Last<\/a>'):
|
||||
get, post, total_pag = scrapertools.find_single_match(data, '<ul class="pagination">.*?<a\s*href="([^"]+pg[\/|=])(\d+)">Next<\/a>.*?<a\s*href="[^"]+pg[\/|=](\d+)">Last<\/a>')
|
||||
else:
|
||||
get, post, total_pag = scrapertools.find_single_match(data, '<ul class="pagination">.*?<a\s*href="([^"]+)"(?:\s*onClick=".*?\(\'([^"]+)\'\);">Next<\/a>.*?onClick=".*?\(\'([^"]+)\'\);">Last<\/a>)')
|
||||
except:
|
||||
post = False
|
||||
cnt_next = 99 #No hay más páginas. Salir del bucle después de procesar ésta
|
||||
cnt_next = 99 #No hay más páginas. Salir del bucle después de procesar ésta
|
||||
|
||||
if post: #puntero a la siguiente página. Cada página de la web tiene 30 entradas
|
||||
if post: #puntero a la siguiente página. Cada página de la web tiene 30 entradas
|
||||
if "pg" in item.post:
|
||||
item.post = re.sub(r"pg=(\d+)", "pg=%s" % post, item.post)
|
||||
else:
|
||||
item.post += "&pg=%s" % post
|
||||
post_num = int(post)-1 #Guardo página actual
|
||||
post_num = int(post)-1 #Guardo página actual
|
||||
|
||||
# Preparamos un patron que pretence recoger todos los datos significativos del video
|
||||
#seleccionamos el bloque que nos interesa
|
||||
if item.extra == "novedades":
|
||||
pattern = '<div class="content">.*?<ul class="noticias(.*?)<\/div><!-- end .content -->' #seleccionamos el bloque que nos interesa
|
||||
pattern = '<div class="content">.*?<ul class="noticias(.*?)<\/div><!-- end .content -->'
|
||||
else:
|
||||
pattern = '<ul class="%s">(.*?)</ul>' % item.pattern #seleccionamos el bloque que nos interesa
|
||||
pattern = '<ul class="%s">(.*?)</ul>' % item.pattern
|
||||
data_alt = data
|
||||
data = scrapertools.get_match(data, pattern)
|
||||
if item.extra == "novedades":
|
||||
@@ -758,29 +768,33 @@ def listado_busqueda(item):
|
||||
if not matches_alt and not '<h3><strong>( 0 ) Resultados encontrados </strong>' in data_alt and not '<ul class="noticias-series"></ul></form></div><!-- end .page-box -->' in data_alt: #error
|
||||
logger.error("ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / DATA: " + data_alt)
|
||||
itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web. Reportar el error con el log'))
|
||||
item, itemlist = generictools.post_tmdb_listado(item, itemlist) #Pintamos los datos de fail-over, si los hay
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
if len(itemlist) > 1:
|
||||
#Pasamos a TMDB la lista completa Itemlist
|
||||
tmdb.set_infoLabels(itemlist, __modo_grafico__)
|
||||
#Llamamos al método para el maquillaje de los títulos obtenidos desde TMDB
|
||||
item, itemlist = generictools.post_tmdb_listado(item, itemlist)
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
|
||||
#Ahora se hace una simulación para saber cuantas líneas podemos albergar en este Itemlist.
|
||||
#Se controlará cuantas páginas web se tienen que leer para rellenar la lista, sin pasarse
|
||||
|
||||
title_lista_alt_for = [] #usamos está lista de urls para el FOR, luego la integramos en la del WHILE
|
||||
title_lista_alt_for = [] #usamos está lista de urls para el FOR, luego la integramos en la del WHILE
|
||||
for scrapedurl, scrapedtitle, scrapedthumbnail, calidad, year, size in matches_alt:
|
||||
|
||||
#Realiza un control de las series que se añaden, ya que el buscador devuelve episodios y no las series completas
|
||||
#Se analiza si la url de la serie ya se ha listado antes. Si es así, esa entrada se ignora
|
||||
#Cuando llega al num. máximo de entradas por página, la pinta y guarda los contadores y la lista de series
|
||||
scrapedurl_alt = scrapedurl
|
||||
if "pelisyseries.com" in host: #Excepción para mispelisyseries.com.
|
||||
scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+-al-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
scrapedurl_alt = re.sub(r'\/\d{5,7}', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
if scrapedurl_alt in title_lista_alt: # si ya se ha tratado, pasamos al siguiente item
|
||||
continue # solo guardamos la url para series y docus
|
||||
if "pelisyseries.com" in host: #Excepción para mispelisyseries.com.
|
||||
scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+-al-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
scrapedurl_alt = re.sub(r'\/\d{5,7}', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
if scrapedurl_alt in title_lista_alt: # si ya se ha tratado, pasamos al siguiente item
|
||||
continue # solo guardamos la url para series y docus
|
||||
|
||||
if scrapedurl_alt in title_lista_alt or scrapedurl_alt in title_lista_alt_for or scrapedthumbnail in title_lista_alt or scrapedthumbnail in title_lista_alt_for: # si ya se ha tratado, pasamos al siguiente item
|
||||
continue # solo guardamos la url para series y docus
|
||||
continue # solo guardamos la url para series y docus
|
||||
|
||||
if ".com/serie" in scrapedurl or "/serie" in scrapedurl or "-serie" in scrapedurl or "varios/" in scrapedurl:
|
||||
title_lista_alt_for += [scrapedurl_alt]
|
||||
@@ -791,16 +805,16 @@ def listado_busqueda(item):
|
||||
cnt_title += 1 # Sería una línea real más para Itemlist
|
||||
|
||||
#Control de página
|
||||
if cnt_title > cnt_tot*0.65: #si se acerca al máximo num. de lineas por pagina, tratamos lo que tenemos
|
||||
cnt_next = 99 #Casi completo, no sobrepasar con la siguiente página
|
||||
if cnt_title > cnt_tot*0.65: #si se acerca al máximo num. de lineas por pagina, tratamos lo que tenemos
|
||||
cnt_next = 99 #Casi completo, no sobrepasar con la siguiente página
|
||||
if cnt_title > cnt_tot:
|
||||
cnt_title = 99 #Sobrepasado el máximo. Ignoro página actual
|
||||
item.post = post_actual #Restauro puntero "next" a la página actual, para releearla en otra pasada
|
||||
post_num -= 1 #Restauro puntero a la página actual en el pie de página
|
||||
cnt_title = 99 #Sobrepasado el máximo. Ignoro página actual
|
||||
item.post = post_actual #Restauro puntero "next" a la página actual, para releearla en otra pasada
|
||||
post_num -= 1 #Restauro puntero a la página actual en el pie de página
|
||||
break
|
||||
|
||||
if cnt_title <= cnt_tot:
|
||||
matches.extend(matches_alt) #Acumulamos las entradas a tratar. Si nos hemos pasado ignoro última página
|
||||
matches.extend(matches_alt) #Acumulamos las entradas a tratar. Si nos hemos pasado ignoro última página
|
||||
title_lista_alt.extend(title_lista_alt_for)
|
||||
|
||||
#logger.debug("PATRON: " + pattern)
|
||||
@@ -817,15 +831,15 @@ def listado_busqueda(item):
|
||||
#El control de página ya se ha realizado más arriba
|
||||
if "pelisyseries.com" in host: #Excepción para mispelisyseries.com.
|
||||
scrapedurl_alt = scrapedurl
|
||||
scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+-al-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
scrapedurl_alt = re.sub(r'\/\d{5,7}', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
if scrapedurl_alt in title_lista: # si ya se ha tratado, pasamos al siguiente item
|
||||
continue # solo guardamos la url para series y docus
|
||||
scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+-al-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-\d+', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
scrapedurl_alt = re.sub(r'\/[c|C]ap.*?-', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
scrapedurl_alt = re.sub(r'\/\d{5,7}', '', scrapedurl_alt) #Scrapeo el capítulo para hacerlo serie
|
||||
if scrapedurl_alt in title_lista: # si ya se ha tratado, pasamos al siguiente item
|
||||
continue # solo guardamos la url para series y docus
|
||||
|
||||
if scrapedurl in title_lista or scrapedthumbnail in title_lista: # si ya se ha tratado, pasamos al siguiente item
|
||||
continue # solo guardamos la url para series y docus
|
||||
if scrapedurl in title_lista or scrapedthumbnail in title_lista: # si ya se ha tratado, pasamos al siguiente item
|
||||
continue # solo guardamos la url para series y docus
|
||||
|
||||
if ".com/serie" in scrapedurl or "/serie" in scrapedurl or "-serie" in scrapedurl or "varios/" in scrapedurl:
|
||||
if "pelisyseries.com" in host:
|
||||
@@ -836,7 +850,7 @@ def listado_busqueda(item):
|
||||
|
||||
if ("juego/" in scrapedurl or "xbox" in scrapedurl.lower()) and not "/serie" in scrapedurl or "xbox" in scrapedtitle.lower() or "windows" in scrapedtitle.lower() or "windows" in calidad.lower() or "nintendo" in scrapedtitle.lower() or "xbox" in calidad.lower() or "epub" in calidad.lower() or "pdf" in calidad.lower() or "pcdvd" in calidad.lower() or "crack" in calidad.lower(): # no mostramos lo que no sean videos
|
||||
continue
|
||||
cnt_title += 1 # Sería una línea real más para Itemlist
|
||||
cnt_title += 1 # Sería una línea real más para Itemlist
|
||||
|
||||
#Creamos una copia de Item para cada contenido
|
||||
item_local = item.clone()
|
||||
@@ -868,8 +882,8 @@ def listado_busqueda(item):
|
||||
#Si son episodios sueltos de Series que vienen de Novedades, se busca la url de la Serie
|
||||
if item.extra == "novedades" and "/serie" in url and episodio_serie == 1:
|
||||
item_local.url = url
|
||||
item_local.extra2 = 'serie_episodios' #Creamos acción temporal excluyente para otros clones
|
||||
if item_local.category == 'Mispelisyseries': #Esta web no gestiona bien el cambio de episodio a Serie
|
||||
item_local.extra2 = 'serie_episodios' #Creamos acción temporal excluyente para otros clones
|
||||
if item_local.category == 'Mispelisyseries': #Esta web no gestiona bien el cambio de episodio a Serie
|
||||
pattern = 'class="btn-torrent">.*?window.location.href = "([^"]+)";' #Patron para .torrent
|
||||
#Como no hay datos consistentes, llamamos al método de fail_over para que encuentre un canal que esté activo y pueda gestionar el cambio de episodio por serie
|
||||
item_local, data_serie = generictools.fail_over_newpct1(item_local, pattern)
|
||||
@@ -885,7 +899,7 @@ def listado_busqueda(item):
|
||||
#Si no hay datos consistentes, llamamos al método de fail_over para que encuentre un canal que esté activo y pueda gestionar el cambio de episodio por serie
|
||||
item_local, data_serie = generictools.fail_over_newpct1(item_local, pattern)
|
||||
|
||||
if not data_serie: #Si no ha logrado encontrar nada, salimos
|
||||
if not data_serie: #Si no ha logrado encontrar nada, salimos
|
||||
title_subs += ["ERR"]
|
||||
|
||||
elif item_local.channel_alt: #Si ha habido fail-over, lo comento
|
||||
@@ -895,9 +909,16 @@ def listado_busqueda(item):
|
||||
try:
|
||||
pattern = '<div class="content">.*?<h1>.*?<a href="([^"]+)"' #Patron para Serie completa
|
||||
item_local.url = scrapertools.find_single_match(data_serie, pattern)
|
||||
if (item.post and '775' in item.post and 'vo/' not in item_local.url) or 'vo/' in url: #Son series VO mal formadas?
|
||||
#Son series VO mal formadas?
|
||||
if (item.post and '775' in item.post and 'vo/' not in item_local.url) or 'vo/' in url:
|
||||
item_local.url = item_local.url.replace('/series/', '/series-vo/')
|
||||
#item_local.url = re.sub(r'\/\d+$', '/', item_local.url) #Quitamos el ID de la serie por compatib.
|
||||
|
||||
#Son series HD formada como series estándar?
|
||||
#if (scrapertools.find_single_match(item_local.quality, '\d{3, 4}p')) and '/series/' in item_local.url:
|
||||
if 'hd/' in url:
|
||||
item_local.url = item_local.url.replace('/series/', '/series-hd/')
|
||||
|
||||
#item_local.url = re.sub(r'\/\d+$', '/', item_local.url) #Quitamos el ID de la serie por compatib.
|
||||
if item_local.url:
|
||||
title_subs += ["Episodio %sx%s" % (scrapertools.find_single_match(url, '\/temp.*?-(\d+)-?\/cap.*?-(\d+(?:-al-\d+)?)-?\/'))]
|
||||
url = item_local.url
|
||||
@@ -965,15 +986,16 @@ def listado_busqueda(item):
|
||||
#Extraemos info adicional del título y la guardamos para después de TMDB
|
||||
if ("temp" in title.lower() or "cap" in title.lower()) and item_local.contentType != "movie":
|
||||
#Eliminamos Temporada de Series, solo nos interesa la serie completa
|
||||
title = re.sub(r' - [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title)
|
||||
title = re.sub(r' - [t|T]emp\w+ \d+[x|X]\d+', '', title)
|
||||
title = re.sub(r' - [t|T]emp\w+ \d+', '', title)
|
||||
title = re.sub(r' - [t|T]emp\w+.*?\d+', '', title)
|
||||
title = re.sub(r'-? [t|T]emp\w+ \d+ Comp\w+\d+[x|X]\d+', ' Completa', title)
|
||||
title = re.sub(r'-? [t|T]emp\w+.?\d+.?[c|C]ap\w+.?\d+.?(?:al|Al|y).?\d+', '', title)
|
||||
title = re.sub(r'-? [t|T]emp\w+ \d+x\d+', '', title)
|
||||
title = re.sub(r'-? [t|T]emp\w+ \d+', '', title)
|
||||
title = re.sub(r'-? [t|T]emp\w+.*?\d+', '', title)
|
||||
title = re.sub(r' [t|T]emp.*?\d+[x|X]\d+', '', title)
|
||||
title = re.sub(r' [t|T]emp.*?\d+', '', title)
|
||||
title = re.sub(r' [c|C]ap.*?\d+ al \d+', '', title)
|
||||
title = re.sub(r' [c|C]ap.*?\d+', '', title)
|
||||
if "audio" in title.lower(): #Reservamos info de audio para después de TMDB
|
||||
if "audio" in title.lower(): #Reservamos info de audio para después de TMDB
|
||||
title_subs += ['[%s]' % scrapertools.find_single_match(title, r'(\[[a|A]udio.*?\])')]
|
||||
title = re.sub(r'\[[a|A]udio.*?\]', '', title)
|
||||
if "[dual" in title.lower() or "multileng" in title.lower() or "multileng" in item_local.quality.lower() or (("espa" in title.lower() or "spani" in title.lower()) and "VOS" in item_local.language):
|
||||
@@ -987,9 +1009,9 @@ def listado_busqueda(item):
|
||||
if "trilog" in title.lower():
|
||||
title_subs += ["[Saga]"]
|
||||
title = title.replace(" Trilogia", "").replace(" trilogia", "").replace(" Trilog", "").replace(" trilog", "")
|
||||
if "extendida" in title.lower():
|
||||
if "extendida" in title.lower() or "v.e." in title.lower()or "v e " in title.lower():
|
||||
title_subs += ["[V. Extendida]"]
|
||||
title = title.replace(" Version Extendida", "").replace(" (Version Extendida)", "").replace(" V. Extendida", "").replace(" VExtendida", "").replace(" V Extendida", "")
|
||||
title = title.replace("Version Extendida", "").replace("(Version Extendida)", "").replace("V. Extendida", "").replace("VExtendida", "").replace("V Extendida", "").replace("V.Extendida", "").replace("V Extendida", "").replace("V.E.", "").replace("V E ", "")
|
||||
if "saga" in title.lower():
|
||||
title = title.replace(" Saga Completa", "").replace(" saga completa", "").replace(" Saga", "").replace(" saga", "")
|
||||
title_subs += ["[Saga]"]
|
||||
@@ -1001,20 +1023,21 @@ 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("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", "").replace("Spanish", "")
|
||||
|
||||
#Limpiamos cabeceras y colas del título
|
||||
title = re.sub(r'Descargar\s\w+\-\w+', '', title)
|
||||
title = re.sub(r'\(COMPLE.*?\)', '', title)
|
||||
|
||||
title = title.replace("Ver online Serie", "").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("en Full HD", "").replace("en hd ", "").replace("en HD ", "").replace("MicroHD", "").replace("HD ", "").replace("(Proper)", "").replace("HDTV", "").replace("RatDVD", "").replace("DVDRiP", "").replace("DVDRIP", "").replace("DVDRip", "").replace("DVDR", "").replace("DVD9", "").replace("DVD", "").replace("DVBRIP", "").replace("DVB", "").replace("LINE", "").replace("calidad", " ").replace("- ES ", "").replace("ES ", "").replace("COMPLETA", "").replace("Serie Animada", " ").replace("(", "-").replace(")", "-").replace(".", " ").strip()
|
||||
|
||||
title = title.replace("Descargar torrent ", "").replace("Descarga Gratis", "").replace("Descarga gratis", "").replace("Descargar Gratis", "").replace("Descargar gratis", "").replace("en gratis", "").replace("gratis gratis", "").replace("Gratisgratis", "").replace("Descargar Estreno ", "").replace("Descargar Estrenos ", "").replace("Pelicula en latino ", "").replace("Descargar Pelicula ", "").replace("Descargar pelicula ", "").replace("Descargar Peliculas ", "").replace("Descargar peliculas ", "").replace("Descargar Todas ", "").replace("Descargar Otras ", "").replace("Descargar ", "").replace("Descarga ", "").replace("Descargar ", "").replace("Decargar ", "").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("4K UHDrip", "").replace("BDremux", "").replace("FULL UHD4K", "").replace("4KULTRA", "").replace("FULLBluRay", "").replace("FullBluRay", "").replace("en BluRay", "").replace("BluRay en", "").replace("Bluray en", "").replace("BluRay", "").replace("Bonus Disc", "").replace("de Cine ", "").replace("TeleCine ", "").replace("latino", "").replace("Latino", "").replace("argentina", "").replace("Argentina", "").replace("++Sub", "").replace("+-+Sub", "").strip()
|
||||
|
||||
title = re.sub(r'\(\d{4}\)$', '', title)
|
||||
if re.sub(r'\d{4}$', '', title).strip():
|
||||
title = re.sub(r'\d{4}$', '', title)
|
||||
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("en Full HD", "").replace("en hd ", "").replace("en HD ", "").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("calidad", " ").replace("- ES ", "").replace("ES ", "").replace("COMPLETA", "").replace("(", "-").replace(")", "-").replace(".", " ").strip()
|
||||
|
||||
title = title.replace("Descargar torrent ", "").replace("Descarga Gratis", "").replace("Descarga gratis", "").replace("Descargar Gratis", "").replace("Descargar gratis", "").replace("en gratis", "").replace("gratis gratis", "").replace("Gratisgratis", "").replace("Descargar Estreno ", "").replace("Descargar Estrenos ", "").replace("Pelicula en latino ", "").replace("Descargar Pelicula ", "").replace("Descargar pelicula ", "").replace("Descargar Peliculas ", "").replace("Descargar peliculas ", "").replace("Descargar Todas ", "").replace("Descargar Otras ", "").replace("Descargar ", "").replace("Descarga ", "").replace("Descargar ", "").replace("Decargar ", "").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("en BluRay", "").replace("BluRay en", "").replace("Bluray en", "").replace("BluRay", "").replace("Bonus Disc", "").replace("de Cine ", "").replace("TeleCine ", "").replace("latino", "").replace("Latino", "").replace("argentina", "").replace("Argentina", "").replace("++Sub", "").replace("+-+Sub", "").strip()
|
||||
title = re.sub(r'\d+x\d+', '', title)
|
||||
title = re.sub(r'x\d+', '', title).strip()
|
||||
|
||||
if "pelisyseries.com" in host and item_local.contentType == "tvshow":
|
||||
titulo = ''
|
||||
@@ -1061,7 +1084,7 @@ def listado_busqueda(item):
|
||||
|
||||
#Limpieza final del título y guardado en las variables según su tipo de contenido
|
||||
item_local.title = title
|
||||
item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título
|
||||
item_local.from_title = title #Guardamos esta etiqueta para posible desambiguación de título
|
||||
if item_local.contentType == "movie":
|
||||
item_local.contentTitle = title
|
||||
size = scrapedsize.replace(".", ",")
|
||||
@@ -1135,18 +1158,20 @@ def listado_busqueda(item):
|
||||
else:
|
||||
item_local.url = url_tvshow #Cambiamos url de episodio por el de serie
|
||||
else:
|
||||
item_local.url = url_id #Cambiamos url de episodio por el de serie
|
||||
item_local.url = url_id #Cambiamos url de episodio por el de serie
|
||||
|
||||
#logger.debug("url: " + item_local.url + " / title o/n: " + item_local.title + " / " + real_title_mps + " / calidad_mps : " + calidad_mps + " / contentType : " + item_local.contentType)
|
||||
|
||||
item_local.title = real_title_mps.replace('-', ' ').title().strip() #Esperemos que el nuevo título esté bien
|
||||
item_local.title = real_title_mps.replace('-', ' ').title().strip() #Esperemos que el nuevo título esté bien
|
||||
item_local.contentSerieName = item_local.title
|
||||
|
||||
#Agrega el item local a la lista itemlist
|
||||
itemlist.append(item_local.clone())
|
||||
|
||||
#if not item.category_new: #Si este campo no existe es que viene de la primera pasada de una búsqueda global
|
||||
# return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo
|
||||
#logger.debug(item_local)
|
||||
|
||||
#if not item.category_new: #Si este campo no existe es que viene de la primera pasada de una búsqueda global
|
||||
# return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo
|
||||
|
||||
#Pasamos a TMDB la lista completa Itemlist
|
||||
tmdb.set_infoLabels(itemlist, __modo_grafico__)
|
||||
@@ -1172,7 +1197,7 @@ def findvideos(item):
|
||||
item.channel_host = host
|
||||
item.category = scrapertools.find_single_match(item.url, 'http.?\:\/\/(?:www.)?(\w+)\.\w+\/').capitalize()
|
||||
|
||||
verify_fo = True #Verificamos si el clone a usar está activo
|
||||
verify_fo = True #Verificamos si el clone a usar está activo
|
||||
item, data = generictools.fail_over_newpct1(item, verify_fo)
|
||||
|
||||
# Cualquiera de las tres opciones son válidas
|
||||
@@ -1185,14 +1210,14 @@ def findvideos(item):
|
||||
#Inicializamos las variables por si hay un error en medio del proceso
|
||||
channel_exclude = []
|
||||
ver_enlaces = []
|
||||
ver_enlaces_veronline = -1 #Ver todos los enlaces Ver Online
|
||||
verificar_enlaces_veronline = -1 #Verificar todos los enlaces Ver Online
|
||||
verificar_enlaces_veronline_validos = True #"¿Contar sólo enlaces 'verificados' en Ver Online?"
|
||||
excluir_enlaces_veronline = [] #Lista vacía de servidores excluidos en Ver Online
|
||||
ver_enlaces_descargas = 0 #Ver todos los enlaces Descargar
|
||||
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
|
||||
ver_enlaces_veronline = -1 #Ver todos los enlaces Ver Online
|
||||
verificar_enlaces_veronline = -1 #Verificar todos los enlaces Ver Online
|
||||
verificar_enlaces_veronline_validos = True #"¿Contar sólo enlaces 'verificados' en Ver Online?"
|
||||
excluir_enlaces_veronline = [] #Lista vacía de servidores excluidos en Ver Online
|
||||
ver_enlaces_descargas = 0 #Ver todos los enlaces Descargar
|
||||
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
|
||||
|
||||
#Leemos las opciones de permitir Servidores para Ver Online y Descargas
|
||||
#Cargamos en .json del canal para ver las listas de valores en settings
|
||||
@@ -1207,16 +1232,16 @@ def findvideos(item):
|
||||
#Primer loop para enlaces de Ver Online.
|
||||
#Carga la variable de ver
|
||||
ver_enlaces_veronline = int(config.get_setting("clonenewpct1_ver_enlaces_veronline", item.channel))
|
||||
if ver_enlaces_veronline == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0
|
||||
if ver_enlaces_veronline == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0
|
||||
ver_enlaces_veronline = -1
|
||||
if ver_enlaces_veronline > 1: #para los demás valores, tomamos los de la lista
|
||||
if ver_enlaces_veronline > 1: #para los demás valores, tomamos los de la lista
|
||||
ver_enlaces_veronline = int(ver_enlaces[ver_enlaces_veronline])
|
||||
|
||||
#Carga la variable de verificar
|
||||
verificar_enlaces_veronline = int(config.get_setting("clonenewpct1_verificar_enlaces_veronline", item.channel))
|
||||
if verificar_enlaces_veronline == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0
|
||||
if verificar_enlaces_veronline == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0
|
||||
verificar_enlaces_veronline = -1
|
||||
if verificar_enlaces_veronline > 1: #para los demás valores, tomamos los de la lista
|
||||
if verificar_enlaces_veronline > 1: #para los demás valores, tomamos los de la lista
|
||||
verificar_enlaces_veronline = int(ver_enlaces[verificar_enlaces_veronline])
|
||||
|
||||
#Carga la variable de contar sólo los servidores verificados
|
||||
@@ -1224,26 +1249,26 @@ def findvideos(item):
|
||||
|
||||
#Carga la variable de lista de servidores excluidos
|
||||
x = 1
|
||||
for x in range(1, max_excl+1): #recorremos todas las opciones de canales exluidos
|
||||
for x in range(1, max_excl+1): #recorremos todas las opciones de canales exluidos
|
||||
valor = str(config.get_setting("clonenewpct1_excluir%s_enlaces_veronline" % x, item.channel))
|
||||
valor = int(valor)
|
||||
if valor > 0: #Evitamos "No"
|
||||
excluir_enlaces_veronline += [channel_exclude[valor]] #Añadimos el nombre de servidor excluido a la lista
|
||||
if valor > 0: #Evitamos "No"
|
||||
excluir_enlaces_veronline += [channel_exclude[valor]] #Añadimos el nombre de servidor excluido a la lista
|
||||
x += 1
|
||||
|
||||
#Segundo loop para enlaces de Descargar.
|
||||
#Carga la variable de ver
|
||||
ver_enlaces_descargas = int(config.get_setting("clonenewpct1_ver_enlaces_descargas", item.channel))
|
||||
if ver_enlaces_descargas == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0
|
||||
if ver_enlaces_descargas == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0
|
||||
ver_enlaces_descargas = -1
|
||||
if ver_enlaces_descargas > 1: #para los demás valores, tomamos los de la lista
|
||||
if ver_enlaces_descargas > 1: #para los demás valores, tomamos los de la lista
|
||||
ver_enlaces_descargas = int(ver_enlaces[ver_enlaces_descargas])
|
||||
|
||||
#Carga la variable de verificar
|
||||
verificar_enlaces_descargas = int(config.get_setting("clonenewpct1_verificar_enlaces_descargas", item.channel))
|
||||
if verificar_enlaces_descargas == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0
|
||||
if verificar_enlaces_descargas == 1: #a "Todos" le damos valor -1. Para "No" dejamos 0
|
||||
verificar_enlaces_descargas = -1
|
||||
if verificar_enlaces_descargas > 1: #para los demás valores, tomamos los de la lista
|
||||
if verificar_enlaces_descargas > 1: #para los demás valores, tomamos los de la lista
|
||||
verificar_enlaces_descargas = int(ver_enlaces[verificar_enlaces_descargas])
|
||||
|
||||
#Carga la variable de contar sólo los servidores verificados
|
||||
@@ -1251,14 +1276,14 @@ def findvideos(item):
|
||||
|
||||
#Carga la variable de lista de servidores excluidos
|
||||
x = 1
|
||||
for x in range(1, max_excl+1): #recorremos todas las opciones de canales exluidos
|
||||
for x in range(1, max_excl+1): #recorremos todas las opciones de canales exluidos
|
||||
valor = str(config.get_setting("clonenewpct1_excluir%s_enlaces_descargas" % x, item.channel))
|
||||
valor = int(valor)
|
||||
if valor > 0: #Evitamos "No"
|
||||
excluir_enlaces_descargas += [channel_exclude[valor]] #Añadimos el nombre de servidor excluido a la lista
|
||||
if valor > 0: #Evitamos "No"
|
||||
excluir_enlaces_descargas += [channel_exclude[valor]] #Añadimos el nombre de servidor excluido a la lista
|
||||
x += 1
|
||||
|
||||
except Exception, ex: #En caso de error, lo mostramos y reseteamos todas las variables
|
||||
except Exception, ex: #En caso de error, lo mostramos y reseteamos todas las variables
|
||||
logger.error("Error en la lectura de parámentros del .json del canal: " + item.channel + " \n%s" % ex)
|
||||
#Mostrar los errores
|
||||
logger.error(ver_enlaces_veronline)
|
||||
@@ -1270,14 +1295,14 @@ def findvideos(item):
|
||||
logger.error(verificar_enlaces_descargas_validos)
|
||||
logger.error(excluir_enlaces_descargas)
|
||||
#Resetear las variables a sus valores por defecto
|
||||
ver_enlaces_veronline = -1 #Ver todos los enlaces Ver Online
|
||||
verificar_enlaces_veronline = -1 #Verificar todos los enlaces Ver Online
|
||||
verificar_enlaces_veronline_validos = True #"¿Contar sólo enlaces 'verificados' en Ver Online?"
|
||||
excluir_enlaces_veronline = [] #Lista vacía de servidores excluidos en Ver Online
|
||||
ver_enlaces_descargas = 0 #Ver todos los enlaces Descargar
|
||||
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
|
||||
ver_enlaces_veronline = -1 #Ver todos los enlaces Ver Online
|
||||
verificar_enlaces_veronline = -1 #Verificar todos los enlaces Ver Online
|
||||
verificar_enlaces_veronline_validos = True #"¿Contar sólo enlaces 'verificados' en Ver Online?"
|
||||
excluir_enlaces_veronline = [] #Lista vacía de servidores excluidos en Ver Online
|
||||
ver_enlaces_descargas = 0 #Ver todos los enlaces Descargar
|
||||
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
|
||||
|
||||
# Descarga la página
|
||||
data = ''
|
||||
@@ -1286,16 +1311,18 @@ def findvideos(item):
|
||||
data = data.replace("$!", "#!").replace("'", "\"").replace("ñ", "ñ").replace("//pictures", "/pictures")
|
||||
url_servidores = item.url
|
||||
category_servidores = item.category
|
||||
data_servidores = data #salvamos data para verificar servidores, si es necesario
|
||||
data_servidores = data #salvamos data para verificar servidores, si es necesario
|
||||
except:
|
||||
pass
|
||||
|
||||
patron = 'class="btn-torrent">.*?window.location.href = "(.*?)";' #Patron para .torrent
|
||||
if not scrapertools.find_single_match(data, patron):
|
||||
patron = '<a href="([^"]+)"\s?title="[^"]+"\s?class="btn-torrent"' #Patron para .torrent (planetatorrent)
|
||||
#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
|
||||
item, itemlist = generictools.post_tmdb_findvideos(item, itemlist) #Llamamos al método para el pintado del error
|
||||
item, itemlist = generictools.post_tmdb_findvideos(item, itemlist) #Llamamos al método para el pintado del error
|
||||
return itemlist #Salimos
|
||||
|
||||
logger.error("ERROR 01: FINDVIDEOS: La Web no responde o la URL es erronea: " + item.url + " / DATA: " + data)
|
||||
@@ -1315,8 +1342,8 @@ def findvideos(item):
|
||||
enlaces_ver = re.compile(patron, re.DOTALL).findall(data_servidores)
|
||||
enlaces_descargar = enlaces_ver
|
||||
|
||||
for logo, servidor, idioma, calidad, enlace, title in enlaces_ver: #buscamos enlaces de servidores de ver-online
|
||||
if ver_enlaces_veronline == 0: #Si no se quiere Ver Online, se sale del bloque
|
||||
for logo, servidor, idioma, calidad, enlace, title in enlaces_ver: #buscamos enlaces de servidores de ver-online
|
||||
if ver_enlaces_veronline == 0: #Si no se quiere Ver Online, se sale del bloque
|
||||
break
|
||||
if "ver" in title.lower():
|
||||
cnt_servidores += 1
|
||||
@@ -1328,7 +1355,7 @@ def findvideos(item):
|
||||
if not data_servidores: #Si no ha logrado encontrar nada nos vamos
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo'))
|
||||
itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: FINDVIDEOS:. La Web no responde o la URL es erronea. 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
|
||||
return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
|
||||
data = data_servidores #restauramos los datos
|
||||
|
||||
@@ -1337,6 +1364,8 @@ def findvideos(item):
|
||||
|
||||
#Añadimos el tamaño para todos
|
||||
size = scrapertools.find_single_match(data, '<div class="entry-left".*?><a href=".*?span class=.*?>Size:<\/strong>?\s(\d+?\.?\d*?\s\w[b|B])<\/span>')
|
||||
if not size: #Para planetatorrent
|
||||
size = scrapertools.find_single_match(data, '<div class="fichas-box"><div class="entry-right"><div style="[^"]+"><span class="[^"]+"><strong>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])\]')
|
||||
@@ -1354,10 +1383,12 @@ def findvideos(item):
|
||||
|
||||
# obtenemos la url torrent
|
||||
patron = 'class="btn-torrent">.*?window.location.href = "(.*?)";' #Patron para .torrent
|
||||
if not scrapertools.find_single_match(data, patron):
|
||||
patron = '<a href="([^"]+)"\s?title="[^"]+"\s?class="btn-torrent"' #Patron para .torrent (planetatorrent)
|
||||
item_local.url = scrapertools.find_single_match(data, patron)
|
||||
if not item_local.url: #error
|
||||
logger.error("ERROR 02: FINDVIDEOS: El archivo Torrent no existe o ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data)
|
||||
item_local.url = item_local.url.replace(" ", "%20") #sustituimos espacios por %20, por si acaso
|
||||
item_local.url = item_local.url.replace(" ", "%20") #sustituimos espacios por %20, por si acaso
|
||||
#logger.debug("Patron: " + patron + " url: " + item_local.url)
|
||||
#logger.debug(data)
|
||||
|
||||
@@ -1367,7 +1398,7 @@ def findvideos(item):
|
||||
quality = '%s [%s]' % (item_local.quality, size) #Agregamos size al final del título
|
||||
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 = '[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
|
||||
item_local.alive = "??" #Calidad del link sin verificar
|
||||
@@ -1400,15 +1431,15 @@ def findvideos(item):
|
||||
cnt_enl_ver = 1
|
||||
cnt_enl_verif = 1
|
||||
for logo, servidor, idioma, calidad, enlace, title in enlaces_ver:
|
||||
if ver_enlaces_veronline == 0: #Si no se quiere Ver Online, se sale del bloque
|
||||
if ver_enlaces_veronline == 0: #Si no se quiere Ver Online, se sale del bloque
|
||||
break
|
||||
if "ver" in title.lower():
|
||||
servidor = servidor.replace("streamin", "streaminto")
|
||||
|
||||
if servidor.capitalize() in excluir_enlaces_veronline: #Servidor excluido, pasamos al siguiente
|
||||
if servidor.capitalize() in excluir_enlaces_veronline: #Servidor excluido, pasamos al siguiente
|
||||
continue
|
||||
mostrar_server = True
|
||||
if config.get_setting("hidepremium"): #Si no se aceptan servidore premium, se ignoran
|
||||
if config.get_setting("hidepremium"): #Si no se aceptan servidore premium, se ignoran
|
||||
mostrar_server = servertools.is_server_enabled(servidor)
|
||||
|
||||
#logger.debug("VER: url: " + enlace + " / title: " + title + " / servidor: " + servidor + " / idioma: " + idioma)
|
||||
@@ -1421,7 +1452,7 @@ def findvideos(item):
|
||||
if verificar_enlaces_veronline == 0:
|
||||
cnt_enl_ver += 1
|
||||
else:
|
||||
break #Si se ha agotado el contador de verificación, se sale de Ver Online
|
||||
break #Si se ha agotado el contador de verificación, se sale de Ver Online
|
||||
|
||||
if devuelve: #Hay link
|
||||
enlace = devuelve[0][1] #Se guarda el link
|
||||
@@ -1430,15 +1461,15 @@ def findvideos(item):
|
||||
if cnt_enl_verif <= verificar_enlaces_veronline or verificar_enlaces_veronline == -1: #contador?
|
||||
#Llama a la subfunción de check_list_links(itemlist) para cada link de servidor
|
||||
item_local.alive = servertools.check_video_link(enlace, servidor, timeout=timeout) #activo el link ?
|
||||
if verificar_enlaces_veronline_validos: #Los links tienen que ser válidos para contarlos?
|
||||
if item_local.alive == "Ok": #Sí
|
||||
if verificar_enlaces_veronline_validos: #Los links tienen que ser válidos para contarlos?
|
||||
if item_local.alive == "Ok": #Sí
|
||||
cnt_enl_verif += 1 #Movemos los contadores
|
||||
cnt_enl_ver += 1 #Movemos los contadores
|
||||
else: #Si no es necesario que sean links válidos, sumamos
|
||||
else: #Si no es necesario que sean links válidos, sumamos
|
||||
cnt_enl_verif += 1 #Movemos los contadores
|
||||
cnt_enl_ver += 1 #Movemos los contadores
|
||||
else:
|
||||
break #Si se ha agotado el contador de verificación, se sale de Ver Online
|
||||
break #Si se ha agotado el contador de verificación, se sale de Ver Online
|
||||
|
||||
#Si el link no está activo se ignora
|
||||
if "??" in item_local.alive: #dudoso
|
||||
@@ -1458,6 +1489,7 @@ def findvideos(item):
|
||||
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()
|
||||
itemlist.append(item_local.clone())
|
||||
|
||||
except:
|
||||
logger.error('ERROR al procesar enlaces VER DIRECTOS: ' + servidor + ' / ' + enlace)
|
||||
|
||||
@@ -1480,7 +1512,7 @@ def findvideos(item):
|
||||
if "Ver" not in title:
|
||||
servidor = servidor.replace("uploaded", "uploadedto")
|
||||
partes = enlace.split(" ") #Partimos el enlace en cada link de las partes
|
||||
title = "Descarga" #Usamos la palabra reservada de Unify para que no formatee el título
|
||||
title = "Descarga" #Usamos la palabra reservada de Unify para que no formatee el título
|
||||
|
||||
if servidor.capitalize() in excluir_enlaces_descargas: #Servidor excluido, pasamos al siguiente
|
||||
continue
|
||||
@@ -1490,10 +1522,12 @@ def findvideos(item):
|
||||
#Recorremos cada una de las partes. Vemos si el primer link está activo. Si no lo está ignoramos todo el enlace
|
||||
p = 1
|
||||
for enlace in partes:
|
||||
if not item.unify: #Si titles Inteligentes NO seleccionados:
|
||||
if not item.unify: #Si titles Inteligentes NO seleccionados:
|
||||
parte_title = "[COLOR yellow][%s][/COLOR] %s (%s/%s) [COLOR limegreen][%s][/COLOR] [COLOR red]%s[/COLOR]" % (servidor.capitalize(), title, p, len(partes), item_local.quality, str(item_local.language))
|
||||
else:
|
||||
parte_title = "[COLOR yellow]%s-[/COLOR] %s %s/%s [COLOR limegreen]-%s[/COLOR] [COLOR red]-%s[/COLOR]" % (servidor.capitalize(), title, p, len(partes), item_local.quality, str(item_local.language))
|
||||
title = title.replace('Descarga', 'Descarg.')
|
||||
item_local.quality = '[/COLOR][COLOR white] %s (%s/%s) [/COLOR][COLOR limegreen][%s] ' % (title, p, len(partes), item.quality)
|
||||
parte_title = "[COLOR yellow][%s]%s[/COLOR] [COLOR red][%s][/COLOR]" % (servidor.capitalize(), item_local.quality, str(item_local.language))
|
||||
p += 1
|
||||
mostrar_server = True
|
||||
if config.get_setting("hidepremium"): #Si no se aceptan servidore premium, se ignoran
|
||||
@@ -1508,7 +1542,7 @@ def findvideos(item):
|
||||
cnt_enl_ver += 1
|
||||
else:
|
||||
ver_enlaces_descargas = 0 #FORZAR SALIR de DESCARGAS
|
||||
break #Si se ha agotado el contador de verificación, se sale de "Enlace"
|
||||
break #Si se ha agotado el contador de verificación, se sale de "Enlace"
|
||||
|
||||
if devuelve:
|
||||
enlace = devuelve[0][1]
|
||||
@@ -1524,12 +1558,12 @@ def findvideos(item):
|
||||
if item_local.alive == "Ok": #Sí
|
||||
cnt_enl_verif += 1 #Movemos los contadores
|
||||
cnt_enl_ver += 1 #Movemos los contadores
|
||||
else: #Si no es necesario que sean links válidos, sumamos
|
||||
else: #Si no es necesario que sean links válidos, sumamos
|
||||
cnt_enl_verif += 1 #Movemos los contadores
|
||||
cnt_enl_ver += 1 #Movemos los contadores
|
||||
else:
|
||||
ver_enlaces_descargas = 0 #FORZAR SALIR de DESCARGAS
|
||||
break #Si se ha agotado el contador de verificación, se sale de "Enlace"
|
||||
break #Si se ha agotado el contador de verificación, se sale de "Enlace"
|
||||
|
||||
if "??" in item_local.alive: #dudoso
|
||||
if not item.unify: #Si titles Inteligentes NO seleccionados:
|
||||
@@ -1552,6 +1586,7 @@ def findvideos(item):
|
||||
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()
|
||||
itemlist.append(item_local.clone())
|
||||
|
||||
except:
|
||||
logger.error('ERROR al procesar enlaces DESCARGAR DIRECTOS: ' + servidor + ' / ' + enlace)
|
||||
|
||||
@@ -1599,7 +1634,7 @@ def episodios(item):
|
||||
pass
|
||||
|
||||
modo_ultima_temp_alt = modo_ultima_temp
|
||||
if item.ow_force == "1": #Si hay un traspaso de canal o url, se actualiza todo
|
||||
if item.ow_force == "1": #Si hay un traspaso de canal o url, se actualiza todo
|
||||
modo_ultima_temp_alt = False
|
||||
|
||||
max_temp = 1
|
||||
@@ -1644,7 +1679,7 @@ def episodios(item):
|
||||
#Si no hay datos consistentes, llamamos al método de fail_over para que encuentre un canal que esté activo y pueda gestionar el vídeo
|
||||
item, data = generictools.fail_over_newpct1(item, patron, pattern)
|
||||
|
||||
if not data: #No se ha encontrado ningún canal activo para este vídeo
|
||||
if not data: #No se ha encontrado ningún canal activo para este vídeo
|
||||
itemlist.append(item.clone(action='', title="[COLOR yellow]" + item.channel.capitalize() + '[/COLOR]: Ningún canal NewPct1 activo'))
|
||||
itemlist.append(item.clone(action='', title=item.category + ': ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log'))
|
||||
return itemlist
|
||||
@@ -1686,13 +1721,14 @@ def episodios(item):
|
||||
data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8")
|
||||
data = data.replace("chapters", "buscar-list") #Compatibilidad con mispelisy.series.com
|
||||
pattern = '<ul class="%s">(.*?)</ul>' % "buscar-list" # item.pattern
|
||||
data = scrapertools.get_match(data, pattern)
|
||||
if not data:
|
||||
data_sector = scrapertools.get_match(data, pattern)
|
||||
if not data_sector:
|
||||
raise
|
||||
data = data_sector
|
||||
except:
|
||||
logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages) + " / DATA: " + str(data))
|
||||
itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: EPISODIOS: 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
|
||||
break #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
|
||||
if "pelisyseries.com" in item.url:
|
||||
pattern = '<li[^>]*><div class.*?src="(?P<thumb>[^"]+)?".*?<a class.*?href="(?P<url>[^"]+).*?<h3[^>]+>(?P<info>.*?)?<\/h3>.*?<\/li>'
|
||||
@@ -1702,10 +1738,10 @@ def episodios(item):
|
||||
if not matches: #error
|
||||
logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / DATA: " + data)
|
||||
itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: EPISODIOS: 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
|
||||
break #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
|
||||
#logger.debug("patron: " + pattern)
|
||||
#logger.debug(matches)
|
||||
#logger.debug(matches)
|
||||
|
||||
#Empezamos a generar cada episodio
|
||||
for scrapedurl, scrapedthumb, info in matches:
|
||||
@@ -1736,7 +1772,7 @@ def episodios(item):
|
||||
logger.debug(item_local.url)
|
||||
info = '><strong>%sTemporada %s Capitulo 0</strong> - <span >Español Castellano</span> Calidad <span >[%s]</span>' % (item_local.contentSerieName, season, item_local.quality)
|
||||
|
||||
else: # old style. Se intenta buscar un patrón que encaje con los diversos formatos antiguos. Si no, se crea
|
||||
else: # old style. Se intenta buscar un patrón que encaje con los diversos formatos antiguos. Si no, se crea
|
||||
pattern = '\[(?P<quality>.*?)\]\[Cap.(?P<season>\d).*?(?P<episode>\d{2})(?:_(?P<season2>\d+)(?P<episode2>\d{2}))?\].*?(?P<lang>.*)?' #Patrón básico por defecto
|
||||
|
||||
if scrapertools.find_single_match(info, '\[\d{3}\]'):
|
||||
@@ -1774,12 +1810,13 @@ def episodios(item):
|
||||
|
||||
r = re.compile(pattern)
|
||||
match = [m.groupdict() for m in r.finditer(info)][0]
|
||||
if not match: #error
|
||||
if not match: #error
|
||||
logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / DATA: " + info)
|
||||
itemlist.append(item.clone(action='', title=item.category + ': ERROR 02: EPISODIOS: 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
|
||||
break #si no hay más datos, algo no funciona, pintamos lo que tenemos
|
||||
|
||||
if match['season'] is None: match['season'] = season #Si no se encuentran valores, pero poner lo básico
|
||||
#Si no se encuentran valores, pero poner lo básico
|
||||
if match['season'] is None or match['season'] == "0" or not match['season']: match['season'] = season
|
||||
if match['episode'] is None: match['episode'] = "0"
|
||||
try:
|
||||
match['season'] = int(match['season'])
|
||||
@@ -1814,11 +1851,11 @@ def episodios(item):
|
||||
item_local.contentEpisodeNumber = match['episode']
|
||||
|
||||
if match["episode2"]: #Hay episodio dos? es una entrada múltiple?
|
||||
item_local.title = "%sx%s al %s -" % (str(match["season"]), str(match["episode"]).zfill(2), str(match["episode2"]).zfill(2)) #Creamos un título con el rango de episodios
|
||||
item_local.title = "%sx%s al %s -" % (str(match["season"]), str(match["episode"]).zfill(2), str(match["episode2"]).zfill(2)) #Creamos un título con el rango de episodios
|
||||
else: #Si es un solo episodio, se formatea ya
|
||||
item_local.title = "%sx%s -" % (match["season"], str(match["episode"]).zfill(2))
|
||||
|
||||
if modo_ultima_temp_alt and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca
|
||||
if modo_ultima_temp_alt and item.library_playcounts: #Si solo se actualiza la última temporada de Videoteca
|
||||
if item_local.contentSeason < max_temp:
|
||||
list_pages = [] #Sale del bucle de leer páginas
|
||||
break #Sale del bucle actual del FOR de episodios por página
|
||||
@@ -1829,6 +1866,7 @@ def episodios(item):
|
||||
if item_local.contentSeason > season_display:
|
||||
continue
|
||||
elif item_local.contentSeason < season_display:
|
||||
list_pages = [] #Sale del bucle de leer páginas
|
||||
break
|
||||
|
||||
if item_local.active:
|
||||
@@ -1851,7 +1889,7 @@ def episodios(item):
|
||||
if len(itemlist) > 1:
|
||||
itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber))) #clasificamos
|
||||
|
||||
if item.season_colapse and not item.add_videolibrary: #Si viene de listado, mostramos solo Temporadas
|
||||
if item.season_colapse and not item.add_videolibrary: #Si viene de listado, mostramos solo Temporadas
|
||||
item, itemlist = generictools.post_tmdb_seasons(item, itemlist)
|
||||
|
||||
if not item.season_colapse: #Si no es pantalla de Temporadas, pintamos todo
|
||||
|
||||
Reference in New Issue
Block a user