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