fixed
This commit is contained in:
Executable → Regular
+81
-48
@@ -84,7 +84,7 @@ def menu_genero(item):
|
|||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
response = httptools.downloadpage("https://kproxy.com/")
|
httptools.downloadpage("https://kproxy.com/")
|
||||||
url = "https://kproxy.com/doproxy.jsp"
|
url = "https://kproxy.com/doproxy.jsp"
|
||||||
post = "page=%s&x=34&y=14" % urllib.quote(host + "/principal")
|
post = "page=%s&x=34&y=14" % urllib.quote(host + "/principal")
|
||||||
response = httptools.downloadpage(url, post, follow_redirects=False).data
|
response = httptools.downloadpage(url, post, follow_redirects=False).data
|
||||||
@@ -108,7 +108,7 @@ def series(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
response = httptools.downloadpage("https://kproxy.com/")
|
httptools.downloadpage("https://kproxy.com/")
|
||||||
url = "https://kproxy.com/doproxy.jsp"
|
url = "https://kproxy.com/doproxy.jsp"
|
||||||
post = "page=%s&x=34&y=14" % urllib.quote(item.url)
|
post = "page=%s&x=34&y=14" % urllib.quote(item.url)
|
||||||
response = httptools.downloadpage(url, post, follow_redirects=False).data
|
response = httptools.downloadpage(url, post, follow_redirects=False).data
|
||||||
@@ -126,17 +126,17 @@ def series(item):
|
|||||||
punt = i.get("puntuacio", "")
|
punt = i.get("puntuacio", "")
|
||||||
valoracion = ""
|
valoracion = ""
|
||||||
if punt and not 0:
|
if punt and not 0:
|
||||||
valoracion = " (Val: {punt})".format(punt=punt)
|
valoracion = " (Val: %s)" % punt
|
||||||
|
|
||||||
title = "{nombre}{val}".format(nombre=i.get("nom", ""), val=valoracion)
|
title = "%s%s" % (i.get("nom", ""), valoracion)
|
||||||
url = "{url}?id={id}".format(url=api_temp, id=i.get("id", ""))
|
url = "%s?id=%s" % (api_temp, i.get("id", ""))
|
||||||
|
|
||||||
thumbnail = ""
|
thumbnail = ""
|
||||||
fanart = ""
|
fanart = ""
|
||||||
if i.get("posterurl", ""):
|
if i.get("posterurl", ""):
|
||||||
thumbnail = "http://image.tmdb.org/t/p/w342{file}".format(file=i.get("posterurl", ""))
|
thumbnail = "http://image.tmdb.org/t/p/w342%s" % i.get("posterurl", "")
|
||||||
if i.get("backurl", ""):
|
if i.get("backurl", ""):
|
||||||
fanart = "http://image.tmdb.org/t/p/w1280{file}".format(file=i.get("backurl", ""))
|
fanart = "http://image.tmdb.org/t/p/w1280%s" % i.get("backurl", "")
|
||||||
|
|
||||||
plot = i.get("info", "")
|
plot = i.get("info", "")
|
||||||
if plot is None:
|
if plot is None:
|
||||||
@@ -165,7 +165,7 @@ def episodios(item):
|
|||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
response = httptools.downloadpage("https://kproxy.com/")
|
httptools.downloadpage("https://kproxy.com/")
|
||||||
url = "https://kproxy.com/doproxy.jsp"
|
url = "https://kproxy.com/doproxy.jsp"
|
||||||
post = "page=%s&x=34&y=14" % urllib.quote(item.url)
|
post = "page=%s&x=34&y=14" % urllib.quote(item.url)
|
||||||
response = httptools.downloadpage(url, post, follow_redirects=False).data
|
response = httptools.downloadpage(url, post, follow_redirects=False).data
|
||||||
@@ -173,48 +173,61 @@ def episodios(item):
|
|||||||
data = httptools.downloadpage(url).data
|
data = httptools.downloadpage(url).data
|
||||||
|
|
||||||
data = jsontools.load(data)
|
data = jsontools.load(data)
|
||||||
for i in data.get("temporadas", []):
|
|
||||||
|
|
||||||
titulo = "{temporada} ({total} Episodios)".format(temporada=i.get("nomtemporada", ""),
|
dict_episodes = dict()
|
||||||
total=len(i.get("capituls", "0")))
|
|
||||||
itemlist.append(Item(channel=item.channel, action="episodios", title=titulo, url=item.url,
|
for i in data.get("temporadas", []):
|
||||||
server="torrent", fanart=item.fanart, thumbnail=item.thumbnail, plot=data.get("info", ""),
|
|
||||||
folder=False))
|
|
||||||
|
|
||||||
for j in i.get("capituls", []):
|
for j in i.get("capituls", []):
|
||||||
|
|
||||||
numero = j.get("infocapitul", "")
|
numero = j.get("infocapitul", "%sx%s" % (i.get("numerotemporada", 0), j.get("numerocapitul", 0)))
|
||||||
if not numero:
|
|
||||||
numero = "{temp}x{cap}".format(temp=i.get("numerotemporada", ""), cap=j.get("numerocapitul", ""))
|
|
||||||
|
|
||||||
titulo = j.get("nomcapitul", "")
|
if numero not in dict_episodes:
|
||||||
if not titulo:
|
dict_episodes[numero] = {}
|
||||||
titulo = "Capítulo {num}".format(num=j.get("numerocapitul", ""))
|
dict_episodes[numero]["title"] = j.get("nomcapitul", "Episodio %s" % j.get("numerocapitul", ""))
|
||||||
|
|
||||||
calidad = ""
|
season = i.get("numerotemporada", 0)
|
||||||
if j.get("links", {}).get("calitat", ""):
|
if type(season) == str:
|
||||||
calidad = " [{calidad}]".format(calidad=j.get("links", {}).get("calitat", ""))
|
season = 0
|
||||||
|
dict_episodes[numero]["season"] = season
|
||||||
|
|
||||||
title = " {numero} {titulo}{calidad}".format(numero=numero, titulo=titulo, calidad=calidad)
|
episode = j.get("numerocapitul", 0)
|
||||||
|
if type(episode) == str:
|
||||||
|
episode = 0
|
||||||
|
dict_episodes[numero]["episode"] = episode
|
||||||
|
|
||||||
|
if j.get("links", {}).get("magnet"):
|
||||||
|
dict_episodes[numero]["url"] = [j.get("links", {}).get("magnet")]
|
||||||
|
dict_episodes[numero]["quality"] = [j.get("links", {}).get("calitat", "")]
|
||||||
|
|
||||||
|
dict_episodes[numero]["plot"] = j.get("overviewcapitul", "")
|
||||||
|
|
||||||
if j.get("links", {}).get("magnet", ""):
|
|
||||||
url = j.get("links", {}).get("magnet", "")
|
|
||||||
else:
|
else:
|
||||||
return [Item(channel=item.channel, title='No hay enlace magnet disponible para este capitulo')]
|
if dict_episodes[numero]["title"] == "":
|
||||||
|
dict_episodes[numero]["title"] = j.get("nomcapitul", "Episodio %s" % j.get("numerocapitul", ""))
|
||||||
|
|
||||||
plot = i.get("overviewcapitul", "")
|
if j.get("links", {}).get("magnet"):
|
||||||
if plot is None:
|
dict_episodes[numero]["url"].append(j.get("links", {}).get("magnet"))
|
||||||
plot = ""
|
dict_episodes[numero]["quality"].append(j.get("links", {}).get("calitat", ""))
|
||||||
|
|
||||||
infoLabels = item.infoLabels
|
if dict_episodes[numero]["plot"] == "":
|
||||||
if plot:
|
dict_episodes[numero]["plot"] = j.get("overviewcapitul", "")
|
||||||
infoLabels["plot"] = plot
|
|
||||||
infoLabels["season"] = i.get("numerotemporada")
|
# logger.debug("\n\n\n dict_episodes: %s " % dict_episodes)
|
||||||
infoLabels["episode"] = j.get("numerocapitul")
|
|
||||||
itemlist.append(
|
for key, value in dict_episodes.items():
|
||||||
Item(channel=item.channel, action="play", title=title, url=url, server="torrent", infoLabels=infoLabels,
|
list_no_duplicate = list(set(value["quality"]))
|
||||||
thumbnail=item.thumbnail, fanart=item.fanart, show=item.show, contentTitle=item.contentTitle,
|
title = "%s %s [%s]" % (key, value["title"], "][".join(list_no_duplicate))
|
||||||
contentSeason=i.get("numerotemporada"), contentEpisodeNumber=j.get("numerocapitul")))
|
|
||||||
|
itemlist.append(
|
||||||
|
Item(channel=item.channel, action="findvideos", title=title, url=url, server="torrent",
|
||||||
|
thumbnail=item.thumbnail, fanart=item.fanart, show=item.show, data=value,
|
||||||
|
contentTitle=item.contentTitle, contentSeason=value["season"],
|
||||||
|
contentEpisodeNumber=value["episode"]))
|
||||||
|
|
||||||
|
# order list
|
||||||
|
if len(itemlist) > 1:
|
||||||
|
itemlist = sorted(itemlist, key=lambda it: (int(it.contentSeason), int(it.contentEpisodeNumber)))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -224,7 +237,7 @@ def pelis(item):
|
|||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
response = httptools.downloadpage("https://kproxy.com/")
|
httptools.downloadpage("https://kproxy.com/")
|
||||||
url = "https://kproxy.com/doproxy.jsp"
|
url = "https://kproxy.com/doproxy.jsp"
|
||||||
post = "page=%s&x=34&y=14" % urllib.quote(item.url)
|
post = "page=%s&x=34&y=14" % urllib.quote(item.url)
|
||||||
response = httptools.downloadpage(url, post, follow_redirects=False).data
|
response = httptools.downloadpage(url, post, follow_redirects=False).data
|
||||||
@@ -242,34 +255,35 @@ def pelis(item):
|
|||||||
valoracion = ""
|
valoracion = ""
|
||||||
|
|
||||||
if punt and not 0:
|
if punt and not 0:
|
||||||
valoracion = " (Val: {punt})".format(punt=punt)
|
valoracion = " (Val: %s)" % punt
|
||||||
|
|
||||||
if i.get("magnets", {}).get("M1080", {}).get("magnet", ""):
|
if i.get("magnets", {}).get("M1080", {}).get("magnet", ""):
|
||||||
url = i.get("magnets", {}).get("M1080", {}).get("magnet", "")
|
url = i.get("magnets", {}).get("M1080", {}).get("magnet", "")
|
||||||
calidad = "[{calidad}]".format(calidad=i.get("magnets", {}).get("M1080", {}).get("quality", ""))
|
calidad = "[%s]" % i.get("magnets", {}).get("M1080", {}).get("quality", "")
|
||||||
else:
|
else:
|
||||||
url = i.get("magnets", {}).get("M720", {}).get("magnet", "")
|
url = i.get("magnets", {}).get("M720", {}).get("magnet", "")
|
||||||
calidad = "[{calidad}]".format(calidad=i.get("magnets", {}).get("M720", {}).get("quality", ""))
|
calidad = "[%s]" % (i.get("magnets", {}).get("M720", {}).get("quality", ""))
|
||||||
|
|
||||||
if not url:
|
if not url:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
title = "{nombre} {calidad}{val}".format(nombre=i.get("nom", ""), val=valoracion, calidad=calidad)
|
title = "%s %s%s" % (i.get("nom", ""), valoracion, calidad)
|
||||||
|
|
||||||
thumbnail = ""
|
thumbnail = ""
|
||||||
fanart = ""
|
fanart = ""
|
||||||
if i.get("posterurl", ""):
|
if i.get("posterurl", ""):
|
||||||
thumbnail = "http://image.tmdb.org/t/p/w342{file}".format(file=i.get("posterurl", ""))
|
thumbnail = "http://image.tmdb.org/t/p/w342%s" % i.get("posterurl", "")
|
||||||
if i.get("backurl", ""):
|
if i.get("backurl", ""):
|
||||||
fanart = "http://image.tmdb.org/t/p/w1280{file}".format(file=i.get("backurl", ""))
|
fanart = "http://image.tmdb.org/t/p/w1280%s" % i.get("backurl", "")
|
||||||
|
|
||||||
plot = i.get("info", "")
|
plot = i.get("info", "")
|
||||||
if plot is None:
|
if plot is None:
|
||||||
plot = ""
|
plot = ""
|
||||||
infoLabels = {'plot': plot, 'year': i.get("year"), 'tmdb_id': i.get("id")}
|
infoLabels = {'plot': plot, 'year': i.get("year"), 'tmdb_id': i.get("id")}
|
||||||
|
|
||||||
itemlist.append(Item(channel=item.channel, action="play", title=title, url=url, server="torrent",
|
itemlist.append(Item(channel=item.channel, action="findvideos", title=title, url=url, server="torrent",
|
||||||
thumbnail=thumbnail, fanart=fanart, infoLabels=infoLabels, contentTitle=i.get("nom")))
|
contentType="movie", thumbnail=thumbnail, fanart=fanart, infoLabels=infoLabels,
|
||||||
|
contentTitle=i.get("nom")))
|
||||||
|
|
||||||
from core import tmdb
|
from core import tmdb
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
||||||
@@ -298,3 +312,22 @@ def search(item, texto):
|
|||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
def findvideos(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
if item.contentType == "movie":
|
||||||
|
item.title = "Enlace Torrent"
|
||||||
|
item.action = "play"
|
||||||
|
itemlist.append(item)
|
||||||
|
else:
|
||||||
|
data = item.data
|
||||||
|
|
||||||
|
for index, url in enumerate(data["url"]):
|
||||||
|
title = "Enlace torrent [%s]" % data["quality"][index]
|
||||||
|
itemlist.append(item.clone(action="play", title=title, url=url))
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|||||||
Reference in New Issue
Block a user