.*?)?<\/h2>'
matches = re.compile(pattern, re.DOTALL).findall(data)
- #logger.debug("patron: " + pattern)
- #logger.debug(matches)
+ logger.debug("patron: " + pattern)
+ logger.debug(matches)
season = "1"
diff --git a/plugin.video.alfa/channels/torrentrapid.py b/plugin.video.alfa/channels/torrentrapid.py
index 2ef3d953..e0a0a09e 100644
--- a/plugin.video.alfa/channels/torrentrapid.py
+++ b/plugin.video.alfa/channels/torrentrapid.py
@@ -99,7 +99,6 @@ def listado(item):
data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data)
#data = httptools.downloadpage(item.url).data
data = unicode(data, "iso-8859-1", errors="replace").encode("utf-8")
-
logger.debug('item.modo: %s'%item.modo)
logger.debug('item.extra: %s'%item.extra)
@@ -167,8 +166,9 @@ def listado(item):
title = title_alt
context_title = title_alt
show = title_alt
- #if item.extra != "buscar-list":
- # title = title + '[' + calidad + "]"
+ if not config.get_setting("unify"): #Si Titulos Inteligentes NO seleccionados:
+ if calidad:
+ title = title + ' [' + calidad + "]"
#Este bucle parece obsoleto:
#context = ""
@@ -257,6 +257,7 @@ def listado_busqueda(item):
if calidad == "":
calidad = title
context = "movie"
+ url_real = True
# no mostramos lo que no sean videos
if "juego/" in url:
@@ -281,22 +282,46 @@ def listado_busqueda(item):
serieid = ""
else:
serieid = ""
-
- url = host + calidad_mps + real_title_mps + "/" + serieid
+
+ #detectar si la url creada de tvshow es válida o hay que volver atras
+ url_tvshow = host + calidad_mps + real_title_mps + "/"
+ url_id = host + calidad_mps + real_title_mps + "/" + serieid
+ data_serie = data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(url_id).data)
+ data_serie = unicode(data_serie, "iso-8859-1", errors="replace").encode("utf-8")
+ data_serie = data_serie.replace("chapters", "buscar-list")
+ pattern = '' % "buscar-list" # item.pattern
+ if not scrapertools.find_single_match(data_serie, pattern):
+ data_serie = data = re.sub(r"\n|\r|\t|\s{2,}", "", httptools.downloadpage(url_tvshow).data)
+ data_serie = unicode(data_serie, "iso-8859-1", errors="replace").encode("utf-8")
+ data_serie = data_serie.replace("chapters", "buscar-list")
+ if not scrapertools.find_single_match(data_serie, pattern):
+ context = "movie"
+ url_real = False
+ if not config.get_setting("unify"): #Si Titulos Inteligentes NO seleccionados:
+ if calidad:
+ title = title + '[' + calidad + "]"
+ else:
+ url = url_tvshow
+ else:
+ url = url_id
real_title_mps = real_title_mps.replace("-", " ")
- #logger.debug("url: " + url + " / title: " + title + " / real_title: " + real_title + " / real_title_mps: " + real_title_mps + " / calidad_mps : " + calidad_mps)
+ logger.debug("url: " + url + " / title: " + title + " / real_title: " + real_title + " / real_title_mps: " + real_title_mps + " / calidad_mps : " + calidad_mps + " / context : " + context)
real_title = real_title_mps
show = real_title
- if ".com/serie" in url and "/miniseries" not in url:
-
+ if ".com/serie" in url and "/miniseries" not in url and url_real:
+ if not config.get_setting("unify"): #Si Titulos Inteligentes NO seleccionados:
+ if calidad:
+ title = title + '[' + calidad + "]"
context = "tvshow"
itemlist.append(Item(channel=item.channel, action="episodios", title=title, url=url, thumbnail=thumb, quality=calidad,
show=show, extra="serie", context=["buscar_trailer"], contentType=context, contentTitle=real_title, contentSerieName=real_title, infoLabels= {'year':year}))
else:
+ if config.get_setting("unify"): #Si Titulos Inteligentes SI seleccionados:
+ title = real_title
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=url, thumbnail=thumb, quality=calidad,
show=show, context=["buscar_trailer"], contentType=context, contentTitle=real_title, infoLabels= {'year':year}))
@@ -307,7 +332,7 @@ def listado_busqueda(item):
if post:
itemlist.append(item.clone(channel=item.channel, action="listado_busqueda", title=">> Página siguiente",
- thumbnail=get_thumb("next.png")))
+ text_color='yellow', text_bold=True, thumbnail=get_thumb("next.png")))
return itemlist
@@ -318,6 +343,8 @@ def findvideos(item):
# item.url = item.url.replace(".com/",".com/ver-online/")
# item.url = item.url.replace(".com/",".com/descarga-directa/")
item.url = item.url.replace(".com/", ".com/descarga-torrent/")
+ #logger.debug("item: ")
+ #logger.debug(item)
# Descarga la página
data = re.sub(r"\n|\r|\t|\s{2}|()", "", httptools.downloadpage(item.url).data)
@@ -334,27 +361,46 @@ def findvideos(item):
# escraped torrent
url = scrapertools.find_single_match(data, patron)
- if item.infoLabels['year']: #añadir el año para series, filtrado por Unify
+ if item.infoLabels['year']: #añadir el año al título general
year = '[%s]' % str(item.infoLabels['year'])
else:
year = ""
+ if item.infoLabels['aired'] and item.contentType == "episode": #añadir el año de episodio para series
+ year = scrapertools.find_single_match(str(item.infoLabels['aired']), r'\/(\d{4})')
+ year = '[%s]' % year
+
+ title_gen = title
if item.contentType == "episode": #scrapear información duplicada en Series
title = re.sub(r'Temp.*?\[', '[', title)
title = re.sub(r'\[Cap.*?\]', '', title)
- title = '%sx%s - %s %s, %s' % (str(item.contentSeason), str(item.contentEpisodeNumber), item.contentTitle, year, title)
+ title_epi = '%sx%s - %s' % (str(item.contentSeason), str(item.contentEpisodeNumber), item.contentTitle)
+ title_gen = '%s %s, %s' % (title_epi, year, title)
+ title_torrent = '%s, %s' % (title_epi, item.contentSerieName)
+ else:
+ title_torrent = item.contentTitle
+
+ if item.infoLabels['quality']:
+ if not config.get_setting("unify"): #Si Titulos Inteligentes NO seleccionados:
+ title_torrent = '%s [%s]' %(title_torrent, item.infoLabels['quality'])
+ else:
+ title_torrent = '%s (%s)' %(title_torrent, item.infoLabels['quality'])
+ if not config.get_setting("unify"): #Si Titulos Inteligentes NO seleccionados:
+ title_gen = '[COLOR gold]**- Título: [/COLOR]%s -**' % (title_gen)
+ else:
+ title_gen = '[COLOR gold]Título: [/COLOR]%s' % (title_gen)
+ if config.get_setting("quit_channel_name", "videolibrary") == 1 and item.contentChannel == "videolibrary":
+ title_gen = '%s: %s' % (item.channel.capitalize(), title_gen)
+ itemlist.append(item.clone(title=title_gen, action="", folder=False)) #Título con todos los datos del vídeo
- itemlist.append(item.clone(title=title, action="", folder=False)) #Título con todos los datos del vídeo
-
- if item.contentType != "episode":
- title = re.sub(r'\s(\[.*?\])', ' ', title) #scrapea calidad en pelis
-
+ title = title_torrent
+ title_torrent = '[COLOR yellow][Torrent]- [/COLOR]%s [online]' % (title_torrent)
if url != "": #Torrent
itemlist.append(
- Item(channel=item.channel, action="play", server="torrent", title=title, fulltitle=title,
+ Item(channel=item.channel, action="play", server="torrent", title=title_torrent, fulltitle=title,
url=url, thumbnail=caratula, plot=item.plot, infoLabels=item.infoLabels, folder=False))
- logger.debug("url: " + url + " / title: " + title + " / calidad: " + item.quality + " / context: " + str(item.context))
+ logger.debug("TORRENT: url: " + url + " / title: " + title + " / calidad: " + item.quality + " / context: " + str(item.context))
# escraped ver vídeos, descargar vídeos un link, múltiples liks
@@ -362,23 +408,6 @@ def findvideos(item):
data = re.sub(r'javascript:;" onClick="popup\("http:\/\/(?:www.)?torrentrapid.com\/\w{1,9}\/library\/include\/ajax\/get_modallinks.php\?links=', "", data)
#logger.debug("matar %s" % data)
- # Antiguo sistema de scrapeo de servidores usado por Newpct1. Como no funciona con torrent.locura, se sustituye por este más común
- #patron_descargar = '