Merge pull request #427 from lopezvg/master

NewPct1: clon Planetatorrent añadido
This commit is contained in:
Alfa
2018-09-05 14:12:16 -05:00
committed by GitHub
13 changed files with 779 additions and 661 deletions
+5 -5
View File
@@ -206,7 +206,7 @@ def listado(item):
if not data and not item.extra2: #Si la web está caída salimos sin dar error if not data and not item.extra2: #Si la web está caída salimos sin dar error
logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + data) logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log'))
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
#Patrón para todo, menos para Series completas, incluido búsquedas en cualquier caso #Patrón para todo, menos para Series completas, incluido búsquedas en cualquier caso
patron = '<tr><td(?: class="[^"]+")?><a href="([^"]+)".?title="([^"]+)".*?<\/a><\/td><td(?: class="[^"]+")?>(?:<a href="[^"]+">)?(.*?)(?:<\/a>)?<\/td><td(?: class="[^"]+")?>.*?<\/td><td(?: class="[^"]+")?>(.*?)<\/td><\/tr>' patron = '<tr><td(?: class="[^"]+")?><a href="([^"]+)".?title="([^"]+)".*?<\/a><\/td><td(?: class="[^"]+")?>(?:<a href="[^"]+">)?(.*?)(?:<\/a>)?<\/td><td(?: class="[^"]+")?>.*?<\/td><td(?: class="[^"]+")?>(.*?)<\/td><\/tr>'
@@ -224,7 +224,7 @@ def listado(item):
logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': 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 break #si no hay más datos, algo no funciona, pintamos lo que tenemos
#logger.debug("PATRON: " + patron) #logger.debug("PATRON: " + patron)
#logger.debug(matches) #logger.debug(matches)
@@ -547,7 +547,7 @@ def episodios(item):
itemlist = [] itemlist = []
item.category = categoria item.category = categoria
logger.debug(item) #logger.debug(item)
if item.from_title: if item.from_title:
item.title = item.from_title item.title = item.from_title
@@ -616,8 +616,8 @@ def episodios(item):
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web. Reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': 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 return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
logger.debug("PATRON: " + patron) #logger.debug("PATRON: " + patron)
logger.debug(matches) #logger.debug(matches)
#logger.debug(data) #logger.debug(data)
season = max_temp season = max_temp
+1 -1
View File
@@ -3,7 +3,7 @@
"name": "Elite Torrent", "name": "Elite Torrent",
"active": true, "active": true,
"adult": false, "adult": false,
"language": ["*"], "language": ["cast", "lat"],
"thumbnail": "elitetorrent.png", "thumbnail": "elitetorrent.png",
"banner": "elitetorrent.png", "banner": "elitetorrent.png",
"categories": [ "categories": [
+1 -1
View File
@@ -380,7 +380,7 @@ def newest(categoria):
item.category_new= 'newest' item.category_new= 'newest'
itemlist = listado(item) itemlist = listado(item)
if itemlist[-1].title == "Página siguiente >>": if "Página siguiente >>" in itemlist[-1].title:
itemlist.pop() itemlist.pop()
# Se captura la excepción, para no interrumpir al canal novedades si un canal falla # Se captura la excepción, para no interrumpir al canal novedades si un canal falla
+3 -2
View File
@@ -3,7 +3,7 @@
"name": "EstrenosGo", "name": "EstrenosGo",
"active": true, "active": true,
"adult": false, "adult": false,
"language": ["cast", "LAT", "VOSE", "VOS"], "language": ["cast", "lat"],
"fanart": "estrenosgo.png", "fanart": "estrenosgo.png",
"thumbnail": "estrenosgo.png", "thumbnail": "estrenosgo.png",
"banner": "estrenosgo.png", "banner": "estrenosgo.png",
@@ -11,7 +11,8 @@
"movie", "movie",
"tvshow", "tvshow",
"torrent", "torrent",
"direct" "direct",
"vos"
], ],
"settings": [ "settings": [
{ {
+13 -3
View File
@@ -215,6 +215,11 @@ def listado(item):
if not data: #Si la web está caída salimos sin dar error if not data: #Si la web está caída salimos sin dar error
logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + url + " / DATA: " + data) logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + url + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log'))
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 return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
#Patrón para todo menos para Series completas #Patrón para todo menos para Series completas
@@ -237,6 +242,11 @@ def listado(item):
logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log'))
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 return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
#logger.debug("PATRON: " + patron) #logger.debug("PATRON: " + patron)
@@ -797,7 +807,7 @@ def findvideos(item):
if not data or not matches: if not data or not matches:
logger.error("ERROR 02: FINDVIDEOS: El enlace no existe o ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) logger.error("ERROR 02: FINDVIDEOS: El enlace no existe o ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: FINDVIDEOS: El enlace no existe o ha cambiado la estructura de la Web. Verificar en la Web y reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: FINDVIDEOS: El enlace no existe o ha cambiado la estructura de la Web. Verificar en la Web y reportar el error con el log'))
break #si no hay más datos, algo no funciona, pasamos a Ver Online continue #si no hay más datos, algo no funciona, salimos
#logger.debug(patron) #logger.debug(patron)
#logger.debug(matches) #logger.debug(matches)
@@ -977,7 +987,7 @@ def episodios(item):
if not data: if not data:
logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea" + item.url) logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea" + item.url)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': 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 break #Pintamos lo que tenemos
curr_page += 1 #Apunto ya a la página siguiente curr_page += 1 #Apunto ya a la página siguiente
@@ -996,7 +1006,7 @@ def episodios(item):
logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web. Reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': 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: " + patron) #logger.debug("PATRON: " + patron)
#logger.debug(matches) #logger.debug(matches)
+3 -2
View File
@@ -3,14 +3,15 @@
"name": "GranTorrent", "name": "GranTorrent",
"active": true, "active": true,
"adult": false, "adult": false,
"language": ["*"], "language": ["cast", "lat"],
"thumbnail": "grantorrent.jpg", "thumbnail": "grantorrent.jpg",
"banner": "grantorrent.png", "banner": "grantorrent.png",
"fanart": "grantorrent.png", "fanart": "grantorrent.png",
"categories": [ "categories": [
"torrent", "torrent",
"movie", "movie",
"tvshow" "tvshow",
"vos"
], ],
"settings": [ "settings": [
{ {
+25 -11
View File
@@ -153,6 +153,11 @@ def listado(item):
if not data: #Si la web está caída salimos sin dar error if not data: #Si la web está caída salimos sin dar error
logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + video_section) logger.error("ERROR 01: LISTADO: La Web no responde o ha cambiado de URL: " + item.url + " / DATA: " + video_section)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log'))
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 return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
#Obtiene la dirección de la próxima página, si la hay #Obtiene la dirección de la próxima página, si la hay
@@ -203,6 +208,11 @@ def listado(item):
logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) logger.error("ERROR 02: LISTADO: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO: Ha cambiado la estructura de la Web. Reportar el error con el log'))
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 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. #Ahora se hace una simulación para saber cuantas líneas podemos albergar en este Itemlist.
@@ -372,6 +382,8 @@ def findvideos(item):
logger.info() logger.info()
itemlist = [] itemlist = []
#logger.debug(item)
#Bajamos los datos de la página #Bajamos los datos de la página
data = '' data = ''
try: try:
@@ -454,19 +466,21 @@ def findvideos(item):
#Tratamos la calidad y tamaño de cada link #Tratamos la calidad y tamaño de cada link
if quality: if quality:
tiempo = '' item_local.quality = quality
if item_local.quality: else:
tiempo = scrapertools.find_single_match(item_local.quality, r'(\s\[.*?\])') item_local.quality = item.quality
item_local.quality = quality + tiempo
if "temporada" in temp_epi.lower(): if "temporada" in temp_epi.lower():
item_local.quality = '%s [Temporada]' % item_local.quality item_local.quality = '%s [Temporada]' % item_local.quality
#Añadimos la duración, que estará en item.quility #Añadimos la duración, que estará en item.quility
if scrapertools.find_single_match(item.quality, '(\[\d+:\d+)'): #si ya tiene la duración, la ponemos if scrapertools.find_single_match(item.quality, '(\[\d+:\d+)') and not scrapertools.find_single_match(item_local.quality, '(\[\d+:\d+)'):
item_local.quality = '%s [%s h]' % (item_local.quality, scrapertools.find_single_match(item.quality, '(\d+:\d+)')) item_local.quality = '%s [/COLOR][COLOR white][%s h]' % (item_local.quality, scrapertools.find_single_match(item.quality, '(\d+:\d+)'))
#if size and item_local.contentType != "episode": #if size and item_local.contentType != "episode":
if size: if size:
size = size.replace(".", ",").replace("B,", " B").replace("b,", " b") size = size.replace(".", ",").replace("B,", " B").replace("b,", " b")
if '[/COLOR][COLOR white]' in item_local.quality:
item_local.quality = '%s [%s]' % (item_local.quality, size) item_local.quality = '%s [%s]' % (item_local.quality, size)
else:
item_local.quality = '%s [/COLOR][COLOR white][%s]' % (item_local.quality, size)
if item_local.action == 'show_result': #Viene de una búsqueda global if item_local.action == 'show_result': #Viene de una búsqueda global
channel = item_local.channel.capitalize() channel = item_local.channel.capitalize()
if item_local.from_channel: if item_local.from_channel:
@@ -596,7 +610,7 @@ def episodios(item):
logger.error("ERROR 05: EPISODIOS: Los links entre temporadas están rotos y se está metiendo en un loop: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / DATA: " + data) logger.error("ERROR 05: EPISODIOS: Los links entre temporadas están rotos y se está metiendo en un loop: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel + ': ERROR 05: EPISODIOS. Los links entre temporadas están rotos y se está metiendo en un loop. Reportar error con log')) itemlist.append(item.clone(action='', title=item.channel + ': ERROR 05: EPISODIOS. Los links entre temporadas están rotos y se está metiendo en un loop. Reportar error con log'))
data = '' data = ''
return itemlist #Algo no funciona con los links, pintamos lo que tenemos break #Algo no funciona con los links, pintamos lo que tenemos
if temp_advance == "back": #Se salta una temporada hacia atrás if temp_advance == "back": #Se salta una temporada hacia atrás
logger.error("ERROR 05: EPISODIOS: Temporada duplicada. Link BACK erroneo: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / Bucle: " + str(temp_bucle) + " / DATA: " + data) logger.error("ERROR 05: EPISODIOS: Temporada duplicada. Link BACK erroneo: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / Bucle: " + str(temp_bucle) + " / DATA: " + data)
temp_actual = scrapertools.find_single_match(data, patron_previous) #url de temporada anterior temp_actual = scrapertools.find_single_match(data, patron_previous) #url de temporada anterior
@@ -625,7 +639,7 @@ def episodios(item):
logger.error("ERROR 05: EPISODIOS: Los links entre temporadas están rotos y se está metiendo en un loop: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / DATA: " + data) logger.error("ERROR 05: EPISODIOS: Los links entre temporadas están rotos y se está metiendo en un loop: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / DATA: " + data)
data = '' data = ''
itemlist.append(item.clone(action='', title=item.channel + ': ERROR 05: EPISODIOS. Los links entre temporadas están rotos y se está metiendo en un loop. Reportar error con log')) itemlist.append(item.clone(action='', title=item.channel + ': ERROR 05: EPISODIOS. Los links entre temporadas están rotos y se está metiendo en un loop. Reportar error con log'))
return itemlist #Algo no funciona con los links, pintamos lo que tenemos break #Algo no funciona con los links, pintamos lo que tenemos
data = '' data = ''
continue #volvemos a leer página con la url de la siguiente continue #volvemos a leer página con la url de la siguiente
@@ -646,7 +660,7 @@ def episodios(item):
logger.error("ERROR 05: EPISODIOS: Los links entre temporadas están rotos y se está metiendo en un loop: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / DATA: " + data) logger.error("ERROR 05: EPISODIOS: Los links entre temporadas están rotos y se está metiendo en un loop: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / Lista temps: " + str(temp_lista) + " / DATA: " + data)
data = '' data = ''
itemlist.append(item.clone(action='', title=item.channel + ': ERROR 05: EPISODIOS. Los links entre temporadas están rotos y se está metiendo en un loop. Reportar error con log')) itemlist.append(item.clone(action='', title=item.channel + ': ERROR 05: EPISODIOS. Los links entre temporadas están rotos y se está metiendo en un loop. Reportar error con log'))
return itemlist #Algo no funciona con los links, pintamos lo que tenemos break #Algo no funciona con los links, pintamos lo que tenemos
data = '' data = ''
continue #volvemos a leer página con la url de la siguiente continue #volvemos a leer página con la url de la siguiente
@@ -660,7 +674,7 @@ def episodios(item):
except: #Error al leer o procesar la página actual? Salimos except: #Error al leer o procesar la página actual? Salimos
logger.error("ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / DATA: " + data) logger.error("ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea: " + temp_actual + " (" + str (temp_actual_num) + ") / Previa: " + temp_previous + " / o Siguiente: " + temp_next + " / Avance: " + temp_advance + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': 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 #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 item.contentType == "season": if item.contentType == "season":
temp_advance = '' #Es la única temporada temp_advance = '' #Es la única temporada
@@ -700,7 +714,7 @@ def episodios(item):
logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web. Reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': 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: " + patron) #logger.debug("PATRON: " + patron)
#logger.debug(matches) #logger.debug(matches)
@@ -3,14 +3,15 @@
"name": "Mejor Torrent 1", "name": "Mejor Torrent 1",
"active": true, "active": true,
"adult": false, "adult": false,
"language": ["*"], "language": ["cast", "lat"],
"thumbnail": "mejortorrent.png", "thumbnail": "mejortorrent.png",
"banner": "mejortorrent.png", "banner": "mejortorrent.png",
"categories": [ "categories": [
"torrent", "torrent",
"movie", "movie",
"tvshow", "tvshow",
"documentary" "documentary",
"vos"
], ],
"settings": [ "settings": [
{ {
+92 -58
View File
@@ -120,10 +120,9 @@ def listado(item):
url_next_page ='' # Control de paginación url_next_page ='' # Control de paginación
cnt_tot = 30 # Poner el num. máximo de items por página cnt_tot = 30 # Poner el num. máximo de items por página
if item.category:
del item.category
if item.totalItems: if item.totalItems:
del item.totalItems del item.totalItems
item.category = item.channel.capitalize()
try: try:
data = '' data = ''
@@ -327,7 +326,10 @@ def listado(item):
data_epi = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item_local.url).data) data_epi = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item_local.url).data)
url = scrapertools.find_single_match(data_epi, '<tr><td>.*<a href="([^"]+)" style="text-decoration:none;"><h1 style=') url = scrapertools.find_single_match(data_epi, '<tr><td>.*<a href="([^"]+)" style="text-decoration:none;"><h1 style=')
if not url: if not url:
url = scrapertools.find_single_match(data_epi, '<td><a href="(secciones.php\?sec\=descargas&ap=[^"]+)"') ### url = scrapertools.find_single_match(data_epi, '<td><a href="(secciones.php\?sec\=descargas&ap=[^"]+)"')
#Probamos si es una temporada completa, aunque no tenga raiz
if not url and scrapertools.find_single_match(data_epi, "(<form (?:style='[^']+'\s)?name='episodios' action='[^']+' method='post'>.*?)<\/form>"):
url = item_local.url #Salvamos la url original
if not url: #No encuentro la Temporada. Lo dejo como capítulo suelto if not url: #No encuentro la Temporada. Lo dejo como capítulo suelto
item_local.action = "findvideos" item_local.action = "findvideos"
item_local.contentEpisodeNumber = episodio item_local.contentEpisodeNumber = episodio
@@ -386,7 +388,7 @@ def listado(item):
# Limpiamos títulos, Sacamos datos de calidad, audio y lenguaje # Limpiamos títulos, Sacamos datos de calidad, audio y lenguaje
scrapedtitle = re.sub('\r\n', '', scrapedtitle_alt).decode('utf8').encode('utf8').strip() scrapedtitle = re.sub('\r\n', '', scrapedtitle_alt).decode('utf8').encode('utf8').strip()
title = scrapedtitle title = scrapedtitle
title = title.replace("á", "a").replace("é", "e").replace("í", "i").replace("ó", "o").replace("ú", "u").replace("ü", "u").replace("�", "ñ").replace("ñ", "ñ") title = title.replace("á", "a").replace("é", "e").replace("í", "i").replace("ó", "o").replace("ú", "u").replace("ü", "u").replace("�", "ñ").replace("ñ", "ñ").replace("&#215;", "x")
title_subs = [] title_subs = []
@@ -400,9 +402,6 @@ def listado(item):
title = title.replace(" Latino", "").replace(" latino", "").replace(" Argentina", "").replace(" argentina", "") title = title.replace(" Latino", "").replace(" latino", "").replace(" Argentina", "").replace(" argentina", "")
title = title.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "") title = title.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "")
if "3d" in title.lower(): #Reservamos info para después de TMDB
item_local.quality += " 3D"
title = title.replace(" [3d]", "").replace(" 3d", "").replace(" [3D]", "").replace(" 3D", "")
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_subs += ['[%s]' % scrapertools.find_single_match(title, r'(\[[a|A]udio.*?\])')]
title = re.sub(r'\[[a|A]udio.*?\]', '', title) title = re.sub(r'\[[a|A]udio.*?\]', '', title)
@@ -435,12 +434,20 @@ def listado(item):
item_local.contentSerieName = "SIN TITULO" item_local.contentSerieName = "SIN TITULO"
if item_local.infoLabels['title']: if item_local.infoLabels['title']:
del item_local.infoLabels['title'] del item_local.infoLabels['title']
if item_local.contentType == "episode":
title = re.sub(r'\d+x\d+(?: al \d+)?', '', title)
if info != "" and not item_local.quality: if info != "" and not item_local.quality:
item_local.quality = info item_local.quality = info
if "(hdrip" in title.lower() or "(br" in title.lower() or "(vhsrip" in title.lower() or "(dvdrip" in title.lower() or "(fullb" in title.lower() or "(blu" in title.lower() or "(4k" in title.lower() or "(hevc" in title.lower() or "(imax" in title.lower() or "extendida" in title.lower() or "[720p]" in title.lower() or "[1080p]" in title.lower(): if not scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') in item_local.quality:
if not item_local.quality: if item_local.quality:
item_local.quality += ' '
item_local.quality = scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') item_local.quality = scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]')
if scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') and not scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') in item_local.quality:
item_local.quality += ' %s' % scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]')
title = re.sub(r'[\[|\(].*?[\)|\]]\s?[\[|\(].*?[\)|\]]', '', title)
title = re.sub(r'[\[|\(].*?[\)|\]]', '', title)
if "(hdrip" in title.lower() or "(br" in title.lower() or "(vhsrip" in title.lower() or "(dvdrip" in title.lower() or "(fullb" in title.lower() or "(blu" in title.lower() or "(4k" in title.lower() or "(hevc" in title.lower() or "(imax" in title.lower() or "extendida" in title.lower() or "[720p]" in title.lower() or "[1080p]" in title.lower():
title = re.sub(r'[\[|\(].*?[\)|\]]', '', title) title = re.sub(r'[\[|\(].*?[\)|\]]', '', title)
if not item_local.quality: if not item_local.quality:
if "fullbluray" in title.lower(): if "fullbluray" in title.lower():
@@ -450,12 +457,13 @@ def listado(item):
item_local.quality = "4K" item_local.quality = "4K"
title = title.replace("4k-hdr", "").replace("4K-HDR", "").replace("hdr", "").replace("HDR", "").replace("4k", "").replace("4K", "") title = title.replace("4k-hdr", "").replace("4K-HDR", "").replace("hdr", "").replace("HDR", "").replace("4k", "").replace("4K", "")
title = title.replace("(", "").replace(")", "").replace("[", "").replace("]", "").strip() title = title.replace("(", "").replace(")", "").replace("[", "").replace("]", "").strip()
if item_local.extra == "peliculas": if item_local.contentType == "movie":
item_local.title = title item_local.title = title
item_local.contentTitle = title item_local.contentTitle = title
elif item_local.contentType != "episode": elif item_local.contentType != "episode":
item_local.title = title item_local.title = title
item_local.title = item_local.contentSerieName item_local.title = item_local.contentSerieName
title = item_local.contentSerieName
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 "saga" in item_local.contentTitle.lower() or "saga" in item_local.contentSerieName.lower(): if "saga" in item_local.contentTitle.lower() or "saga" in item_local.contentSerieName.lower():
@@ -532,10 +540,20 @@ def listado_busqueda(item):
except: except:
logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL: " + item.url + item.post + " / DATA: " + data) logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL: " + item.url + item.post + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO_BUSQUEDA:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO_BUSQUEDA:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log'))
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 return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
if not data: #Si la web está caída salimos sin dar error if not data: #Si la web está caída salimos sin dar error
logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL: " + item.url + item.post + " / DATA: " + data) logger.error("ERROR 01: LISTADO_BUSQUEDA: La Web no responde o ha cambiado de URL: " + item.url + item.post + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO_BUSQUEDA:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: LISTADO_BUSQUEDA:. La Web no responde o ha cambiado de URL. Si la Web está activa, reportar el error con el log'))
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 return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
cnt_next += 1 cnt_next += 1
@@ -561,7 +579,11 @@ def listado_busqueda(item):
logger.error("ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) logger.error("ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: LISTADO_BUSQUEDA: Ha cambiado la estructura de la Web. Reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': 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) #Llamamos al método para el pintado del error 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 return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
#Capturamos el num. de la última página para informala a pié de página #Capturamos el num. de la última página para informala a pié de página
@@ -591,7 +613,7 @@ def listado_busqueda(item):
item_local = item.clone() item_local = item.clone()
if item_local.category: if item_local.category:
category = item.category category = item.category
del item_local.category item_local.category = item_local.channel.capitalize()
item_local.tipo = True item_local.tipo = True
del item_local.tipo del item_local.tipo
if item_local.totalItems: if item_local.totalItems:
@@ -624,9 +646,6 @@ def listado_busqueda(item):
title = title.replace(" Latino", "").replace(" latino", "").replace(" Argentina", "").replace(" argentina", "") title = title.replace(" Latino", "").replace(" latino", "").replace(" Argentina", "").replace(" argentina", "")
title = title.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "") title = title.replace("Castellano", "").replace("castellano", "").replace("inglés", "").replace("ingles", "").replace("Inglés", "").replace("Ingles", "")
if "3d" in title or "3D" in title: #Reservamos info para después de TMDB
item_local.quality += " 3D"
title = title.replace(" [3d]", "").replace(" 3d", "").replace(" [3D]", "").replace(" 3D", "")
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_subs += ['[%s]' % scrapertools.find_single_match(title, r'(\[[a|A]udio.*?\])')]
title = re.sub(r'\[[a|A]udio.*?\]', '', title) title = re.sub(r'\[[a|A]udio.*?\]', '', title)
@@ -645,7 +664,8 @@ def listado_busqueda(item):
title = scrapertools.remove_htmltags(title) title = scrapertools.remove_htmltags(title)
# Ahora preparamos el título y la calidad tanto para series como para documentales y películas # Ahora preparamos el título y la calidad tanto para series como para documentales y películas
if item.extra == "novedades" and ("Series" in scrapedtype or "Documentales" in scrapedtype): #if item.extra == "novedades" and ("Series" in scrapedtype or "Documentales" in scrapedtype):
if item.extra == "novedades":
item_local.quality = scrapertools.find_single_match(scrapedtitle, '.*?\[(.*?)\]') item_local.quality = scrapertools.find_single_match(scrapedtitle, '.*?\[(.*?)\]')
else: else:
item_local.quality = scrapertools.remove_htmltags(scrapedquality).decode('utf8').encode('utf8') item_local.quality = scrapertools.remove_htmltags(scrapedquality).decode('utf8').encode('utf8')
@@ -661,7 +681,7 @@ def listado_busqueda(item):
item_local.contentType = "season" item_local.contentType = "season"
title = re.sub(r'\[\d+.*?\]', '', title) # Quitar la calidad del título title = re.sub(r'\[\d+.*?\]', '', title) # Quitar la calidad del título
item_local.contentSerieName = scrapertools.find_single_match(title, '(.*?) Temporada \d+\s?').strip() item_local.contentSerieName = scrapertools.find_single_match(title, '(.*?) Temporada\s?(?:\d+)?\s?').strip()
if not item_local.contentSerieName: if not item_local.contentSerieName:
item_local.contentSerieName = title.strip() item_local.contentSerieName = title.strip()
if item_local.infoLabels['title']: if item_local.infoLabels['title']:
@@ -673,12 +693,17 @@ def listado_busqueda(item):
item_local.contentSeason = scrapertools.find_single_match(scrapedurl, 'temporada-?(?:\d+p-)?(\d{1,2})[-|\/]') item_local.contentSeason = scrapertools.find_single_match(scrapedurl, 'temporada-?(?:\d+p-)?(\d{1,2})[-|\/]')
if not item_local.contentSeason: if not item_local.contentSeason:
item_local.contentSeason = 1 item_local.contentSeason = 1
title = title.replace('Temporada', '').replace('temporada', '')
if not scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]') in item_local.quality:
if item_local.quality:
item_local.quality += ' '
item_local.quality += scrapertools.find_single_match(title, '[\[|\(](.*?)[\)|\]]')
if scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') and not scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]') in item_local.quality:
item_local.quality += ' %s' % scrapertools.find_single_match(title, '[\[|\(].*?[\)|\]]\s?[\[|\(](.*?)[\)|\]]')
title = re.sub(r'[\[|\(].*?[\)|\]]\s?[\[|\(].*?[\)|\]]', '', title)
title = re.sub(r'[\[|\(].*?[\)|\]]', '', title)
if "(hdrip" in title.lower() or "(br" in title.lower() or "(vhsrip" in title.lower() or "(dvdrip" in title.lower() or "(fullb" in title.lower() or "(blu" in title.lower() or "(4k" in title.lower() or "(hevc" in title.lower() or "(imax" in title.lower() or "extendida" in title.lower() or "[720p]" in title.lower() or "[1080p]" in title.lower(): if "(hdrip" in title.lower() or "(br" in title.lower() or "(vhsrip" in title.lower() or "(dvdrip" in title.lower() or "(fullb" in title.lower() or "(blu" in title.lower() or "(4k" in title.lower() or "(hevc" in title.lower() or "(imax" in title.lower() or "extendida" in title.lower() or "[720p]" in title.lower() or "[1080p]" in title.lower():
if not item_local.quality:
item_local.quality = scrapertools.find_single_match(title, r'\(.*?\)?\(.*?\)')
if not item_local.quality:
item_local.quality = scrapertools.find_single_match(title, r'[\[|\(](.*?)[\)|\]]')
title = re.sub(r'\(.*?\)?\(.*?\)', '', title) title = re.sub(r'\(.*?\)?\(.*?\)', '', title)
title = re.sub(r'[\[|\(].*?[\)|\]]', '', title) title = re.sub(r'[\[|\(].*?[\)|\]]', '', title)
if not item_local.quality: if not item_local.quality:
@@ -744,6 +769,8 @@ def findvideos(item):
logger.info() logger.info()
itemlist = [] itemlist = []
#logger.debug(item)
data = '' data = ''
torrent_data = '' torrent_data = ''
headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Referer': item.url} #Necesario para el Post del .Torrent headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Referer': item.url} #Necesario para el Post del .Torrent
@@ -781,7 +808,7 @@ def findvideos(item):
#logger.debug(matches) #logger.debug(matches)
#logger.debug(data) #logger.debug(data)
for scrapedurl, name1, value1, value2, name2 in matches: for scrapedurl, name1, value1, value2, name2 in matches: #Hacemos el FOR aunque solo habrá un item
#Generamos una copia de Item para trabajar sobre ella #Generamos una copia de Item para trabajar sobre ella
item_local = item.clone() item_local = item.clone()
url = scrapedurl url = scrapedurl
@@ -794,7 +821,7 @@ def findvideos(item):
pass pass
else: else:
#Generamos una copia de Item para trabajar sobre ella #Viene de SERIES y DOCUMENTALES. Generamos una copia de Item para trabajar sobre ella
item_local = item.clone() item_local = item.clone()
try: #Localiza el .torrent en el siguiente link con Post. Viene de Documentales y Varios try: #Localiza el .torrent en el siguiente link con Post. Viene de Documentales y Varios
url = item.url_post url = item.url_post
@@ -802,7 +829,6 @@ def findvideos(item):
except: except:
pass pass
#logger.debug(torrent_data.headers)
if not torrent_data: if not torrent_data:
item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada
if item.intervencion: #Sí ha sido clausurada judicialmente if item.intervencion: #Sí ha sido clausurada judicialmente
@@ -813,7 +839,8 @@ def findvideos(item):
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: FINDVIDEOS: El archivo Torrent no existe o ha cambiado la estructura de la Web. Verificar en la Web y reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: FINDVIDEOS: El archivo Torrent no existe o ha cambiado la estructura de la Web. Verificar en la Web y 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
item_local.url = torrent_data.headers['location'] #Capturamos la url del .torrent desde el Header #Capturamos la url del .torrent desde el Header
item_local.url = torrent_data.headers['location'] if 'location' in torrent_data.headers else item.url_post
item_local.url = item_local.url.replace(" ", "%20") #Quitamos espacios item_local.url = item_local.url.replace(" ", "%20") #Quitamos espacios
# Poner la calidad, si es necesario # Poner la calidad, si es necesario
@@ -862,28 +889,38 @@ def episodios(item):
tmdb.set_infoLabels(item, True) tmdb.set_infoLabels(item, True)
# Carga la página # Carga la página
data = '' data_ini = ''
try: try:
data = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url).data) data_ini = re.sub(r"\n|\r|\t|\s{2}|(<!--.*?-->)", "", httptools.downloadpage(item.url).data)
data = data.replace('"', "'") data_ini = data_ini.replace('"', "'")
except: #Algún error de proceso, salimos except: #Algún error de proceso, salimos
pass pass
if not data: if not data_ini:
logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea" + item.url) logger.error("ERROR 01: EPISODIOS: La Web no responde o la URL es erronea" + item.url)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 01: EPISODIOS:. La Web no responde o la URL es erronea. Si la Web está activa, reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': 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 return itemlist
# Selecciona en tramo que nos interesa # Selecciona en tramo que nos interesa
data = scrapertools.find_single_match(data, "(<form (?:style='[^']+'\s)?name='episodios' action='[^']+' method='post'>.*?)<\/form>") data = scrapertools.find_single_match(data_ini, "(<form (?:style='[^']+'\s)?name='episodios' action='[^']+' method='post'>.*?)<\/form>")
# Prepara el patrón de búsqueda # Prepara el patrón de búsqueda
if item.extra == "documentales": patron = "<form (?:style='[^']+'\s)?name='episodios' action='([^']+)'"
patron = "<form (?:style='[^']+'\s)?name='episodios' action='([^']+)'.*?<input type='hidden' value='([^']+)' name='([^']+)'>" url = scrapertools.find_single_match(data, patron) #Salvamos la url de descarga
url, value2, name2 = scrapertools.find_single_match(data, patron) url = url.replace('descargar_series.php', 'descargar.php') #ESTA DESCARGARÍA EL TORRENT EN VEZ DEL ENLACE
patron = "<input type='\w+' name='([^']+)' value='([^']+)'>" patron = "<form (?:style='[^']+'\s)?name='episodios' action='[^']+'.*?<input type='hidden' value='([^']+)' name='([^']+)'>"
else: value2 = '' #Patrón general para Documentales (1)
patron = "<td bgcolor='[^>]+><a href='([^']+)'>[^<]+<\/a><\/td><td[^>]+><div[^>]+>([^<]+)?<\/div><\/td>" name2 = ''
if scrapertools.find_single_match(data, patron):
value2, name2 = scrapertools.find_single_match(data, patron) #extraemos valores para el Post
patron = "<td bgcolor='[^>]+><a href='([^']+)'>[^<]+<\/a><\/td><td[^>]+><div[^>]+>[^<]+?<\/div><\/td>.*?<input type='\w+'\s?name='([^']+)'\s?value='([^']+)'>\s?<\/td><\/tr>" #Patrón para series con Post
if not scrapertools.find_single_match(data, patron):
patron = "<form name='episodios' action='([^']+)'.*?<input type='\w+' name='([^']+)' value='([^']+)'>"
if not scrapertools.find_single_match(data, patron): #Patrón para documentales (2)
#Si no han funcionado los anteriores, usamos el tradicional para series sin Post
patron = "<td bgcolor='[^>]+><a href='([^']+)'>[^<]+<\/a><\/td><td[^>]+><div([^>]+)>([^<]+)?<\/div><\/td>"
matches = re.compile(patron, re.DOTALL).findall(data) matches = re.compile(patron, re.DOTALL).findall(data)
if not matches: #error if not matches: #error
item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada
@@ -891,7 +928,7 @@ def episodios(item):
item, itemlist = generictools.post_tmdb_episodios(item, itemlist) #Llamamos al método para el pintado del error item, itemlist = generictools.post_tmdb_episodios(item, itemlist) #Llamamos al método para el pintado del error
return itemlist #Salimos return itemlist #Salimos
logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data) logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA_INI: " + data_ini + " / DATA: " + data)
itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web. Reportar el error con el log')) itemlist.append(item.clone(action='', title=item.channel.capitalize() + ': 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 return itemlist #si no hay más datos, algo no funciona, pintamos lo que tenemos
@@ -900,7 +937,7 @@ def episodios(item):
#logger.debug(data) #logger.debug(data)
# Recorremos todos los episodios generando un Item local por cada uno en Itemlist # Recorremos todos los episodios generando un Item local por cada uno en Itemlist
for scrapedurl, year in matches: for scrapedurl, name1, value1 in matches:
item_local = item.clone() item_local = item.clone()
item_local.action = "findvideos" item_local.action = "findvideos"
item_local.contentType = "episode" item_local.contentType = "episode"
@@ -922,22 +959,22 @@ def episodios(item):
item_local.context = "['buscar_trailer']" item_local.context = "['buscar_trailer']"
item_local.url = scrapedurl item_local.url = scrapedurl
if item.extra == "documentales": #llamada con post if name1 and value1: #llamada con post
name1 = scrapedurl item_local.url = item.url #Dejamos la url de la Temporada como Refer
value1 = year item_local.url_post = url #Ponemos la url de Descarga (retocado)
item_local.url = item.url item_local.post = '%s=%s' % (name1, value1) #Ponemos la primera pareja de valores
item_local.url_post = url if not name2 and not value2: #Si no hay segunda pareja...
item_local.post = '%s=%s&%s=%s' % (name1, value1, name2, value2) item_local.post = '%s=0&id_post=%s' % (name1, value1) #... adaptamos el formato final
item_local.contentSeason = 1 if name2 and value2: #Si hay segunda pareja, la añadimos
try: if item_local.post:
item_local.contentEpisodeNumber = int(value1) + 1 item_local.post += '&'
except: item_local.post += '%s=%s' % (name2, value2)
item_local.contentEpisodeNumber = 1
else: scrapedtemp = ''
scrapedtemp, scrapedepi = scrapertools.find_single_match(item_local.url, "\/.*?-(\d{1,2})x(\d{1,2})[-|\/]") scrapedepi = ''
scrapedepi2 = scrapertools.find_single_match(item_local.url, "\/.*?-\d{1,2}x\d{1,2}-al-\d{1,2}x(\d{1,2})[-|\/]") if scrapertools.find_single_match(scrapedurl, "\/.*?-(\d{1,2})x(\d{1,2})[-|\/]"):
item_local.title = '%sx%s -' % (scrapedtemp, str(scrapedepi).zfill(2)) scrapedtemp, scrapedepi = scrapertools.find_single_match(scrapedurl, "\/.*?-(\d{1,2})x(\d{1,2})[-|\/]")
scrapedepi2 = scrapertools.find_single_match(scrapedurl, "\/.*?-\d{1,2}x\d{1,2}-al-\d{1,2}x(\d{1,2})[-|\/]")
try: try:
item_local.contentSeason = int(scrapedtemp) item_local.contentSeason = int(scrapedtemp)
except: except:
@@ -952,13 +989,10 @@ def episodios(item):
scrapedepi2 = '' scrapedepi2 = ''
if scrapedepi2: if scrapedepi2:
item_local.title = '%sx%s al %s -' % (scrapedtemp, str(scrapedepi).zfill(2), str(scrapedepi2).zfill(2)) item_local.title = '%sx%s al %s -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2), str(scrapedepi2).zfill(2))
#item_local.infoLabels['episodio_titulo'] = 'al %s' % scrapedepi2 #item_local.infoLabels['episodio_titulo'] = 'al %s' % scrapedepi2
else: else:
item_local.title = '%sx%s -' % (scrapedtemp, str(scrapedepi).zfill(2)) item_local.title = '%sx%s -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber).zfill(2))
if year:
item_local.infoLabels['year'] = scrapertools.find_single_match(year, r"(\d{4})")
itemlist.append(item_local.clone()) itemlist.append(item_local.clone())
+4 -3
View File
@@ -3,7 +3,7 @@
"name": "Newpct1", "name": "Newpct1",
"active": true, "active": true,
"adult": false, "adult": false,
"language": ["*"], "language": ["cast", "lat"],
"thumbnail": "newpct1.png", "thumbnail": "newpct1.png",
"banner": "newpct1.png", "banner": "newpct1.png",
"categories": [ "categories": [
@@ -44,6 +44,7 @@
"Tumejortorrent", "Tumejortorrent",
"Torrentlocura", "Torrentlocura",
"Tvsinpagar", "Tvsinpagar",
"Planetatorrent",
"Descargas2020", "Descargas2020",
"Mispelisyseries" "Mispelisyseries"
] ]
@@ -52,7 +53,7 @@
"id": "clonenewpct1_channels_list", "id": "clonenewpct1_channels_list",
"type": "text", "type": "text",
"label": "Lista de clones de NewPct1 y orden de uso", "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, "enabled": true,
"visible": false "visible": false
}, },
@@ -60,7 +61,7 @@
"id": "intervenidos_channels_list", "id": "intervenidos_channels_list",
"type": "text", "type": "text",
"label": "Lista de canales y clones de NewPct1 intervenidos y orden de sustitución de URLs", "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, "enabled": true,
"visible": false "visible": false
}, },
+82 -44
View File
@@ -513,14 +513,16 @@ def listado(item):
title = title.replace("(2D)", "").replace("(2d)", "").replace("2D", "").replace("2d", "") title = title.replace("(2D)", "").replace("(2d)", "").replace("2D", "").replace("2d", "")
title_subs += ["[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()) and item_local.contentType != "movie":
if "temp" in title.lower() or "cap" in title.lower(): #Eliminamos Temporada, solo nos interesa la serie completa #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+ 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+.?[c|C]ap\w+.?\d+.?(?:al|Al|y).?\d+', '', title)
title = re.sub(r' - [t|T]emp\w+ \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\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' [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) 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_subs += ['[%s]' % scrapertools.find_single_match(title, r'(\[[a|A]udio.*?\])')]
@@ -536,9 +538,9 @@ def listado(item):
if "trilog" in title.lower(): if "trilog" in title.lower():
title_subs += ["[Saga]"] title_subs += ["[Saga]"]
title = title.replace(" Trilogia", "").replace(" trilogia", "").replace(" Trilog", "").replace(" trilog", "") 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_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(): if "saga" in title.lower():
title = title.replace(" Saga Completa", "").replace(" saga sompleta", "").replace(" Saga", "").replace(" saga", "") title = title.replace(" Saga Completa", "").replace(" saga sompleta", "").replace(" Saga", "").replace(" saga", "")
title_subs += ["[Saga]"] title_subs += ["[Saga]"]
@@ -549,21 +551,22 @@ def listado(item):
title_subs += ["[Miniserie]"] title_subs += ["[Miniserie]"]
#Limpiamos restos en título #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", "")
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_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 #Limpiamos cabeceras y colas del título
title = re.sub(r'Descargar\s\w+\-\w+', '', title) title = re.sub(r'Descargar\s\w+\-\w+', '', title)
title = re.sub(r'\(COMPLE.*?\)', '', 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) title = re.sub(r'\(\d{4}\)$', '', title)
if re.sub(r'\d{4}$', '', title).strip(): if re.sub(r'\d{4}$', '', title).strip():
title = re.sub(r'\d{4}$', '', title) title = re.sub(r'\d{4}$', '', title)
title = re.sub(r'\d+x\d+', '', title) title = re.sub(r'\d+x\d+', '', title)
title = re.sub(r' x\d+', '', title) title = re.sub(r'x\d+', '', title).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("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()
if title.endswith("torrent gratis"): title = title[:-15] if title.endswith("torrent gratis"): title = title[:-15]
if title.endswith("gratis"): title = title[:-7] if title.endswith("gratis"): title = title[:-7]
@@ -692,10 +695,11 @@ def listado_busqueda(item):
pass pass
cnt_next += 1 cnt_next += 1
#seleccionamos el bloque que nos interesa
if item.extra == "novedades": 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: 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): 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 item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada
if item.intervencion: #Sí ha sido clausurada judicialmente if item.intervencion: #Sí ha sido clausurada judicialmente
@@ -709,6 +713,11 @@ def listado_busqueda(item):
if not data: #Si no ha logrado encontrar nada, salimos 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="[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')) 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'))
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 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 elif item.channel_alt: #Si ha habido fail-over, lo comento
host = host.replace(item.channel_alt, item.channel) host = host.replace(item.channel_alt, item.channel)
@@ -716,9 +725,9 @@ def listado_busqueda(item):
#Obtiene la dirección de la próxima página, si la hay #Obtiene la dirección de la próxima página, si la hay
try: try:
post_actual = item.post #Guardamos el post actual por si hay overflow de Itemlist y hay que hechar marcha atrás 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 item.extra == "novedades": 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>') 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: else:
get, post, total_pag = scrapertools.find_single_match(data, '<ul class="pagination">.*?<a\s*href="([^"]+)"(?:\s*onClick=".*?\(\'([^"]+)\'\);">Next<\/a>.*?onClick=".*?\(\'([^"]+)\'\);">Last<\/a>)') get, post, total_pag = scrapertools.find_single_match(data, '<ul class="pagination">.*?<a\s*href="([^"]+)"(?:\s*onClick=".*?\(\'([^"]+)\'\);">Next<\/a>.*?onClick=".*?\(\'([^"]+)\'\);">Last<\/a>)')
except: except:
@@ -733,10 +742,11 @@ def listado_busqueda(item):
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 # Preparamos un patron que pretence recoger todos los datos significativos del video
#seleccionamos el bloque que nos interesa
if item.extra == "novedades": 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: 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_alt = data
data = scrapertools.get_match(data, pattern) data = scrapertools.get_match(data, pattern)
if item.extra == "novedades": if item.extra == "novedades":
@@ -758,7 +768,11 @@ 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 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) 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')) 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 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 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. #Ahora se hace una simulación para saber cuantas líneas podemos albergar en este Itemlist.
@@ -895,8 +909,15 @@ def listado_busqueda(item):
try: try:
pattern = '<div class="content">.*?<h1>.*?<a href="([^"]+)"' #Patron para Serie completa pattern = '<div class="content">.*?<h1>.*?<a href="([^"]+)"' #Patron para Serie completa
item_local.url = scrapertools.find_single_match(data_serie, pattern) 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 = item_local.url.replace('/series/', '/series-vo/')
#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. #item_local.url = re.sub(r'\/\d+$', '/', item_local.url) #Quitamos el ID de la serie por compatib.
if item_local.url: if item_local.url:
title_subs += ["Episodio %sx%s" % (scrapertools.find_single_match(url, '\/temp.*?-(\d+)-?\/cap.*?-(\d+(?:-al-\d+)?)-?\/'))] title_subs += ["Episodio %sx%s" % (scrapertools.find_single_match(url, '\/temp.*?-(\d+)-?\/cap.*?-(\d+(?:-al-\d+)?)-?\/'))]
@@ -965,10 +986,11 @@ def listado_busqueda(item):
#Extraemos info adicional del título y la guardamos para después de TMDB #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": 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 #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+ 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+.?[c|C]ap\w+.?\d+.?(?:al|Al|y).?\d+', '', title)
title = re.sub(r' - [t|T]emp\w+ \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\w+.*?\d+', '', title)
title = re.sub(r' [t|T]emp.*?\d+[x|X]\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' [t|T]emp.*?\d+', '', title)
title = re.sub(r' [c|C]ap.*?\d+ al \d+', '', title) title = re.sub(r' [c|C]ap.*?\d+ al \d+', '', title)
@@ -987,9 +1009,9 @@ def listado_busqueda(item):
if "trilog" in title.lower(): if "trilog" in title.lower():
title_subs += ["[Saga]"] title_subs += ["[Saga]"]
title = title.replace(" Trilogia", "").replace(" trilogia", "").replace(" Trilog", "").replace(" trilog", "") 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_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(): if "saga" in title.lower():
title = title.replace(" Saga Completa", "").replace(" saga completa", "").replace(" Saga", "").replace(" saga", "") title = title.replace(" Saga Completa", "").replace(" saga completa", "").replace(" Saga", "").replace(" saga", "")
title_subs += ["[Saga]"] title_subs += ["[Saga]"]
@@ -1001,20 +1023,21 @@ def listado_busqueda(item):
title_subs += ["[Miniserie]"] title_subs += ["[Miniserie]"]
#Limpiamos restos en título #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 #Limpiamos cabeceras y colas del título
title = re.sub(r'Descargar\s\w+\-\w+', '', title) title = re.sub(r'Descargar\s\w+\-\w+', '', title)
title = re.sub(r'\(COMPLE.*?\)', '', 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) title = re.sub(r'\(\d{4}\)$', '', title)
if re.sub(r'\d{4}$', '', title).strip(): if re.sub(r'\d{4}$', '', title).strip():
title = re.sub(r'\d{4}$', '', title) title = re.sub(r'\d{4}$', '', title)
title = re.sub(r'\d+x\d+', '', title) title = re.sub(r'\d+x\d+', '', title)
title = re.sub(r' x\d+', '', title) title = re.sub(r'x\d+', '', title).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("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()
if "pelisyseries.com" in host and item_local.contentType == "tvshow": if "pelisyseries.com" in host and item_local.contentType == "tvshow":
titulo = '' titulo = ''
@@ -1145,6 +1168,8 @@ def listado_busqueda(item):
#Agrega el item local a la lista itemlist #Agrega el item local a la lista itemlist
itemlist.append(item_local.clone()) itemlist.append(item_local.clone())
#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 #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 # return itemlist #Retornamos sin pasar por la fase de maquillaje para ahorra tiempo
@@ -1291,6 +1316,8 @@ def findvideos(item):
pass pass
patron = 'class="btn-torrent">.*?window.location.href = "(.*?)";' #Patron para .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)
#Verificamos si se ha cargado una página, y si además tiene la estructura correcta #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): if not data or not scrapertools.find_single_match(data, patron):
item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada item = generictools.web_intervenida(item, data) #Verificamos que no haya sido clausurada
@@ -1337,6 +1364,8 @@ def findvideos(item):
#Añadimos el tamaño para todos #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>') 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 size = size.replace(".", ",") #sustituimos . por , porque Unify lo borra
if not size: if not size:
size = scrapertools.find_single_match(item.quality, '\s\[(\d+,?\d*?\s\w[b|B])\]') size = scrapertools.find_single_match(item.quality, '\s\[(\d+,?\d*?\s\w[b|B])\]')
@@ -1354,6 +1383,8 @@ def findvideos(item):
# obtenemos la url torrent # obtenemos la url torrent
patron = 'class="btn-torrent">.*?window.location.href = "(.*?)";' #Patron para .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) item_local.url = scrapertools.find_single_match(data, patron)
if not item_local.url: #error 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) logger.error("ERROR 02: FINDVIDEOS: El archivo Torrent no existe o ha cambiado la estructura de la Web " + " / PATRON: " + patron + " / DATA: " + data)
@@ -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()
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()) itemlist.append(item_local.clone())
except: except:
logger.error('ERROR al procesar enlaces VER DIRECTOS: ' + servidor + ' / ' + enlace) logger.error('ERROR al procesar enlaces VER DIRECTOS: ' + servidor + ' / ' + enlace)
@@ -1493,7 +1525,9 @@ def findvideos(item):
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)) 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: 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 p += 1
mostrar_server = True 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
@@ -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'\s\[COLOR \w+\]\[\[?\]?\]\[\/COLOR\]', '', item_local.title).strip()
item_local.title = re.sub(r'\[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()) itemlist.append(item_local.clone())
except: except:
logger.error('ERROR al procesar enlaces DESCARGAR DIRECTOS: ' + servidor + ' / ' + enlace) logger.error('ERROR al procesar enlaces DESCARGAR DIRECTOS: ' + servidor + ' / ' + enlace)
@@ -1686,13 +1721,14 @@ def episodios(item):
data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8") data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8")
data = data.replace("chapters", "buscar-list") #Compatibilidad con mispelisy.series.com data = data.replace("chapters", "buscar-list") #Compatibilidad con mispelisy.series.com
pattern = '<ul class="%s">(.*?)</ul>' % "buscar-list" # item.pattern pattern = '<ul class="%s">(.*?)</ul>' % "buscar-list" # item.pattern
data = scrapertools.get_match(data, pattern) data_sector = scrapertools.get_match(data, pattern)
if not data: if not data_sector:
raise raise
data = data_sector
except: except:
logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / " + str(list_pages) + " / DATA: " + str(data)) 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')) 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: if "pelisyseries.com" in item.url:
pattern = '<li[^>]*><div class.*?src="(?P<thumb>[^"]+)?".*?<a class.*?href="(?P<url>[^"]+).*?<h3[^>]+>(?P<info>.*?)?<\/h3>.*?<\/li>' pattern = '<li[^>]*><div class.*?src="(?P<thumb>[^"]+)?".*?<a class.*?href="(?P<url>[^"]+).*?<h3[^>]+>(?P<info>.*?)?<\/h3>.*?<\/li>'
@@ -1702,7 +1738,7 @@ def episodios(item):
if not matches: #error if not matches: #error
logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / DATA: " + data) 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')) 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("patron: " + pattern)
#logger.debug(matches) #logger.debug(matches)
@@ -1777,9 +1813,10 @@ def episodios(item):
if not match: #error if not match: #error
logger.error("ERROR 02: EPISODIOS: Ha cambiado la estructura de la Web " + " / PATRON: " + pattern + " / DATA: " + info) 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')) 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" if match['episode'] is None: match['episode'] = "0"
try: try:
match['season'] = int(match['season']) match['season'] = int(match['season'])
@@ -1829,6 +1866,7 @@ def episodios(item):
if item_local.contentSeason > season_display: if item_local.contentSeason > season_display:
continue continue
elif item_local.contentSeason < season_display: elif item_local.contentSeason < season_display:
list_pages = [] #Sale del bucle de leer páginas
break break
if item_local.active: if item_local.active:
+18 -1
View File
@@ -322,9 +322,18 @@ def post_tmdb_listado(item, itemlist):
if item_local.contentType == 'season': if item_local.contentType == 'season':
item_local.title = item_local.from_title item_local.title = item_local.from_title
#Limpiamos calidad de títulos originales que se hayan podido colar
if item_local.infoLabels['originaltitle'].lower() in item_local.quality.lower():
item_local.quality = re.sub(item_local.infoLabels['originaltitle'], '', item_local.quality, flags=re.IGNORECASE)
# Preparamos el título para series, con los núm. de temporadas, si las hay # Preparamos el título para series, con los núm. de temporadas, si las hay
if item_local.contentType in ['season', 'tvshow', 'episode']: if item_local.contentType in ['season', 'tvshow', 'episode']:
if item_local.contentType == "episode": if item_local.contentType == "episode":
#Si no está el título del episodio, pero sí está en "title", lo rescatamos
if not item_local.infoLabels['episodio_titulo'] and item_local.infoLabels['title'].lower() != item_local.infoLabels['tvshowtitle'].lower():
item_local.infoLabels['episodio_titulo'] = item_local.infoLabels['title']
if "Temporada" in title: #Compatibilizamos "Temporada" con Unify if "Temporada" in title: #Compatibilizamos "Temporada" con Unify
title = '%sx%s al 99 -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber)) title = '%sx%s al 99 -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber))
if " al " in title: #Si son episodios múltiples, ponemos nombre de serie if " al " in title: #Si son episodios múltiples, ponemos nombre de serie
@@ -335,7 +344,7 @@ def post_tmdb_listado(item, itemlist):
elif item_local.infoLabels['episodio_titulo']: elif item_local.infoLabels['episodio_titulo']:
title = '%s %s, %s' % (title, item_local.infoLabels['episodio_titulo'], item_local.contentSerieName) title = '%s %s, %s' % (title, item_local.infoLabels['episodio_titulo'], item_local.contentSerieName)
item_local.infoLabels['episodio_titulo'] = '%s- %s [%s] [%s]' % (item_local.infoLabels['episodio_titulo'], item_local.contentSerieName, item_local.infoLabels['year'], rating) item_local.infoLabels['episodio_titulo'] = '%s, %s [%s] [%s]' % (item_local.infoLabels['episodio_titulo'], item_local.contentSerieName, item_local.infoLabels['year'], rating)
else: #Si no hay título de episodio, ponermos el nombre de la serie else: #Si no hay título de episodio, ponermos el nombre de la serie
if item_local.contentSerieName not in title: if item_local.contentSerieName not in title:
@@ -750,6 +759,14 @@ def post_tmdb_episodios(item, itemlist):
elif item_local.infoLabels['aired']: elif item_local.infoLabels['aired']:
item_local.infoLabels['year'] = scrapertools.find_single_match(str(item_local.infoLabels['aired']), r'\/(\d{4})') item_local.infoLabels['year'] = scrapertools.find_single_match(str(item_local.infoLabels['aired']), r'\/(\d{4})')
#Limpiamos calidad de títulos originales que se hayan podido colar
if item_local.infoLabels['originaltitle'].lower() in item_local.quality.lower():
item_local.quality = re.sub(item_local.infoLabels['originaltitle'], '', item_local.quality, flags=re.IGNORECASE)
#Si no está el título del episodio, pero sí está en "title", lo rescatamos
if not item_local.infoLabels['episodio_titulo'] and item_local.infoLabels['title'].lower() != item_local.infoLabels['tvshowtitle'].lower():
item_local.infoLabels['episodio_titulo'] = item_local.infoLabels['title']
#Preparamos el título para que sea compatible con Añadir Serie a Videoteca #Preparamos el título para que sea compatible con Añadir Serie a Videoteca
if "Temporada" in item_local.title: #Compatibilizamos "Temporada" con Unify if "Temporada" in item_local.title: #Compatibilizamos "Temporada" con Unify
item_local.title = '%sx%s al 99 -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber)) item_local.title = '%sx%s al 99 -' % (str(item_local.contentSeason), str(item_local.contentEpisodeNumber))
@@ -469,6 +469,7 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
self.ok_enabled = False self.ok_enabled = False
self.default_enabled = False self.default_enabled = False
if config.get_platform(True)['num_version'] < 18:
if xbmcgui.__version__ == "1.2": if xbmcgui.__version__ == "1.2":
self.setCoordinateResolution(1) self.setCoordinateResolution(1)
else: else: