This commit is contained in:
Alfa-beto
2017-09-13 23:11:26 +00:00
committed by GitHub
parent 82cc5fba8b
commit ba97efc440
3 changed files with 11 additions and 9 deletions
+10 -5
View File
@@ -273,13 +273,13 @@ def listado_series(item):
def fichas(item):
logger.info()
itemlist = []
textoidiomas=''
infoLabels=dict()
## Carga estados
status = jsontools.load(httptools.downloadpage(host + '/a/status/all').data)
if item.title == "Buscar...":
data = agrupa_datos(httptools.downloadpage(item.url, post=item.extra).data)
s_p = scrapertools.get_match(data, '<h3 class="section-title">(.*?)<div id="footer-wrapper">').split(
'<h3 class="section-title">')
@@ -320,10 +320,12 @@ def fichas(item):
if scrapedlangs != ">":
textoidiomas = extrae_idiomas(scrapedlangs)
#Todo Quitar el idioma
title += bbcode_kodi2html(" ( [COLOR teal][B]" + textoidiomas + "[/B][/COLOR])")
if scrapedrating != ">":
valoracion = re.sub(r'><[^>]+>(\d+)<b class="dec">(\d+)</b>', r'\1,\2', scrapedrating)
infoLabels['rating']=valoracion
title += bbcode_kodi2html(" ([COLOR orange]" + valoracion + "[/COLOR])")
url = urlparse.urljoin(item.url, scrapedurl)
@@ -349,7 +351,7 @@ def fichas(item):
itemlist.append(
Item(channel=item.channel, action=action, title=title, url=url, fulltitle=title, thumbnail=thumbnail,
show=show, folder=True, contentType=contentType, contentTitle=contentTitle,
language =textoidiomas+'x'))
language =textoidiomas, infoLabels=infoLabels))
## Paginación
next_page_url = scrapertools.find_single_match(data, '<a href="([^"]+)">.raquo;</a>')
@@ -794,11 +796,14 @@ def agrupa_datos(data):
def extrae_idiomas(bloqueidiomas):
logger.info("idiomas=" + bloqueidiomas)
# Todo cambiar por lista
#textoidiomas=[]
textoidiomas = ''
patronidiomas = '([a-z0-9]+).png"'
idiomas = re.compile(patronidiomas, re.DOTALL).findall(bloqueidiomas)
textoidiomas = ""
for idioma in idiomas:
textoidiomas = textoidiomas + idioma.upper() + " "
textoidiomas = textoidiomas + idioma +" "
#textoidiomas.append(idioma.upper())
return textoidiomas