@@ -3,6 +3,7 @@
|
||||
from core import httptools
|
||||
from core import scrapertools
|
||||
from core import servertools
|
||||
from core import tmdb
|
||||
from core.item import Item
|
||||
from platformcode import config, logger
|
||||
|
||||
@@ -84,19 +85,19 @@ def peliculas(item):
|
||||
year = scrapertools.find_single_match(varios, 'Año.*?kinopoisk">([^<]+)')
|
||||
year = scrapertools.find_single_match(year, '[0-9]{4}')
|
||||
mtitulo = titulo + " (" + idioma + ") (" + year + ")"
|
||||
new_item = Item(channel = item.channel,
|
||||
action = "findvideos",
|
||||
title = mtitulo,
|
||||
fulltitle = titulo,
|
||||
thumbnail = thumbnail,
|
||||
url = url,
|
||||
contentTitle = titulo,
|
||||
contentType="movie",
|
||||
language = idioma
|
||||
)
|
||||
if year:
|
||||
new_item.infoLabels['year'] = int(year)
|
||||
itemlist.append(new_item)
|
||||
item.infoLabels['year'] = int(year)
|
||||
itemlist.append(item.clone(channel = item.channel,
|
||||
action = "findvideos",
|
||||
title = mtitulo,
|
||||
fulltitle = titulo,
|
||||
thumbnail = thumbnail,
|
||||
url = url,
|
||||
contentTitle = titulo,
|
||||
contentType="movie",
|
||||
language = idioma
|
||||
))
|
||||
tmdb.set_infoLabels(itemlist, True)
|
||||
url_pagina = scrapertools.find_single_match(data, 'next" href="([^"]+)')
|
||||
if url_pagina != "":
|
||||
pagina = "Pagina: " + scrapertools.find_single_match(url_pagina, "page/([0-9]+)")
|
||||
@@ -121,13 +122,12 @@ def findvideos(item):
|
||||
elif "vimeo" in url:
|
||||
url += "|" + "http://www.allcalidad.com"
|
||||
itemlist.append(
|
||||
Item(channel = item.channel,
|
||||
item.clone(channel = item.channel,
|
||||
action = "play",
|
||||
title = titulo,
|
||||
fulltitle = item.fulltitle,
|
||||
thumbnail = item.thumbnail,
|
||||
url = url
|
||||
))
|
||||
tmdb.set_infoLabels(itemlist, True)
|
||||
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
||||
if itemlist:
|
||||
itemlist.append(Item(channel = item.channel))
|
||||
@@ -137,8 +137,7 @@ def findvideos(item):
|
||||
if item.extra != "library":
|
||||
if config.get_videolibrary_support():
|
||||
itemlist.append(Item(channel=item.channel, title="Añadir a la videoteca", text_color="green",
|
||||
filtro=True, action="add_pelicula_to_library", url=item.url, thumbnail = item.thumbnail,
|
||||
infoLabels={'title': item.fulltitle}, fulltitle=item.fulltitle
|
||||
action="add_pelicula_to_library", url=item.url, thumbnail = item.thumbnail
|
||||
))
|
||||
return itemlist
|
||||
|
||||
|
||||
@@ -65,27 +65,33 @@ def findvideos(item):
|
||||
patron += '>([^<]+)'
|
||||
matches = scrapertools.find_multiple_matches(data, patron)
|
||||
for url, calidad in matches:
|
||||
itemlist.append(Item(
|
||||
itemlist.append(item.clone(
|
||||
channel = item.channel,
|
||||
action = "play",
|
||||
title = calidad,
|
||||
fulltitle = item.title,
|
||||
contentThumbnail = item.thumbnail,
|
||||
url = url,
|
||||
))
|
||||
itemlist = servertools.get_servers_itemlist(itemlist)
|
||||
itemlist.append(Item(channel=item.channel))
|
||||
if config.get_videolibrary_support():
|
||||
itemlist.append(Item(channel=item.channel, title="Añadir a la videoteca", text_color="green",
|
||||
filtro=True, action="add_pelicula_to_library", url=item.url, thumbnail = item.thumbnail,
|
||||
infoLabels={'title': item.fulltitle}, fulltitle=item.fulltitle
|
||||
))
|
||||
try:
|
||||
tmdb.set_infoLabels(itemlist, __modo_grafico__)
|
||||
except:
|
||||
pass
|
||||
|
||||
itemlist = servertools.get_servers_itemlist(itemlist)
|
||||
itemlist.append(Item(channel=item.channel))
|
||||
if config.get_videolibrary_support():
|
||||
itemlist.append(Item(channel=item.channel, title="Añadir a la videoteca", text_color="green",
|
||||
action="add_pelicula_to_library", url=item.url, thumbnail = item.thumbnail,
|
||||
))
|
||||
return itemlist
|
||||
|
||||
|
||||
def play(item):
|
||||
logger.info()
|
||||
item.thumbnail = item.contentThumbnail
|
||||
return [item]
|
||||
|
||||
|
||||
def lista(item):
|
||||
logger.info()
|
||||
itemlist = []
|
||||
@@ -112,6 +118,10 @@ def lista(item):
|
||||
itemlist.append(item.clone(action="findvideos", title=title, fulltitle=title, url=url, thumbnail=thumb,
|
||||
plot=plot, context=["buscar_trailer"], contentTitle=title, contentType="movie"))
|
||||
|
||||
try:
|
||||
tmdb.set_infoLabels(itemlist, __modo_grafico__)
|
||||
except:
|
||||
pass
|
||||
pagina = scrapertools.find_single_match(item.url, 'page=([0-9]+)')
|
||||
item.url = item.url.replace(pagina, "")
|
||||
if pagina == "":
|
||||
@@ -121,12 +131,6 @@ def lista(item):
|
||||
if item.extra != "busqueda":
|
||||
itemlist.append(Item(channel = item.channel, action="lista", title="Pagina %s" %pagina, url=item.url, extra1 = item.extra1
|
||||
))
|
||||
try:
|
||||
# Obtenemos los datos basicos de todas las peliculas mediante multihilos
|
||||
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
||||
except:
|
||||
pass
|
||||
|
||||
return itemlist
|
||||
|
||||
def search(item, texto):
|
||||
|
||||
@@ -152,6 +152,7 @@ def peliculas(item):
|
||||
new_item.infoLabels['year'] = int(year)
|
||||
itemlist.append(new_item)
|
||||
|
||||
tmdb.set_infoLabels(itemlist, __modo_grafico__)
|
||||
# Extrae el paginador
|
||||
next_page_link = scrapertools.find_single_match(data, '<link rel="next" href="([^"]+)')
|
||||
if next_page_link:
|
||||
@@ -273,9 +274,8 @@ def findvideos(item):
|
||||
if item.extra != "library":
|
||||
if config.get_videolibrary_support():
|
||||
itemlist.append(Item(channel=item.channel, title="Añadir a la videoteca", text_color="green",
|
||||
filtro=True, action="add_pelicula_to_library", url=item.url,
|
||||
infoLabels={'title': item.fulltitle}, fulltitle=item.fulltitle,
|
||||
extra="library"))
|
||||
action="add_pelicula_to_library", url=item.url
|
||||
))
|
||||
|
||||
else:
|
||||
itemlist.append(item.clone(title="No hay enlaces disponibles", action="", text_color=color3))
|
||||
@@ -319,34 +319,35 @@ def bloque_enlaces(data, filtro_idioma, dict_idiomas, type, item):
|
||||
scrapedurl = match[0]
|
||||
scrapedserver = match[1]
|
||||
scrapedcalidad = match[2]
|
||||
scrapedlanguage = match[3]
|
||||
language = match[3]
|
||||
scrapedtipo = match[4]
|
||||
if t_tipo.upper() not in scrapedtipo.upper():
|
||||
continue
|
||||
title = " Mirror en %s (" + scrapedlanguage + ")"
|
||||
title = " Mirror en %s (" + language + ")"
|
||||
if len(scrapedcalidad.strip()) > 0:
|
||||
title += " (Calidad " + scrapedcalidad.strip() + ")"
|
||||
|
||||
if filtro_idioma == 3 or item.filtro:
|
||||
lista_enlaces.append(item.clone(title=title, action="play", text_color=color2,
|
||||
url=scrapedurl, server=scrapedserver, idioma=scrapedlanguage,
|
||||
url=scrapedurl, server=scrapedserver,
|
||||
extra=item.url, contentThumbnail = item.thumbnail,
|
||||
language=scrapedlanguage))
|
||||
language=language))
|
||||
else:
|
||||
idioma = dict_idiomas[language]
|
||||
if idioma == filtro_idioma:
|
||||
lista_enlaces.append(item.clone(title=title, text_color=color2, action="play", url=scrapedurl,
|
||||
lista_enlaces.append(item.clone(title=title, action="play", text_color=color2,
|
||||
url=scrapedurl, server=scrapedserver,
|
||||
extra=item.url, contentThumbnail = item.thumbnail,
|
||||
language=scrapedlanguage))
|
||||
language=language))
|
||||
else:
|
||||
if language not in filtrados:
|
||||
filtrados.append(language)
|
||||
lista_enlaces = servertools.get_servers_itemlist(lista_enlaces, lambda i: i.title % i.server.capitalize())
|
||||
if filtro_idioma != 3:
|
||||
if len(filtrados) > 0:
|
||||
title = "Mostrar enlaces filtrados en %s" % ", ".join(filtrados)
|
||||
title = "Mostrar también enlaces filtrados en %s" % ", ".join(filtrados)
|
||||
lista_enlaces.append(item.clone(title=title, action="findvideos", url=item.url, text_color=color3,
|
||||
filtro=True))
|
||||
lista_enlaces = servertools.get_servers_itemlist(lista_enlaces, lambda i: i.title % i.server.capitalize())
|
||||
return lista_enlaces
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user