Varios
allcalidad: fix favoritos repelis: nuevo canal httptools: raise para varios S.O. rapidvideo: updated
This commit is contained in:
@@ -34,12 +34,40 @@ def mainlist(item):
|
|||||||
itemlist.append(Item(channel = item.channel, title = "Novedades", action = "peliculas", url = host, thumbnail = get_thumb("newest", auto = True)))
|
itemlist.append(Item(channel = item.channel, title = "Novedades", action = "peliculas", url = host, thumbnail = get_thumb("newest", auto = True)))
|
||||||
itemlist.append(Item(channel = item.channel, title = "Por género", action = "generos_years", url = host, extra = "Genero", thumbnail = get_thumb("genres", auto = True) ))
|
itemlist.append(Item(channel = item.channel, title = "Por género", action = "generos_years", url = host, extra = "Genero", thumbnail = get_thumb("genres", auto = True) ))
|
||||||
itemlist.append(Item(channel = item.channel, title = "Por año", action = "generos_years", url = host, extra = ">Año<", thumbnail = get_thumb("year", auto = True)))
|
itemlist.append(Item(channel = item.channel, title = "Por año", action = "generos_years", url = host, extra = ">Año<", thumbnail = get_thumb("year", auto = True)))
|
||||||
itemlist.append(Item(channel = item.channel, title = "Favoritas", action = "peliculas", url = host + "/favorites", thumbnail = get_thumb("favorites", auto = True) ))
|
itemlist.append(Item(channel = item.channel, title = "Favoritas", action = "favorites", url = host + "/favorites", thumbnail = get_thumb("favorites", auto = True) ))
|
||||||
itemlist.append(Item(channel = item.channel, title = ""))
|
itemlist.append(Item(channel = item.channel, title = ""))
|
||||||
itemlist.append(Item(channel = item.channel, title = "Buscar", action = "search", url = host + "?s=", thumbnail = get_thumb("search", auto = True)))
|
itemlist.append(Item(channel = item.channel, title = "Buscar", action = "search", url = host + "?s=", thumbnail = get_thumb("search", auto = True)))
|
||||||
autoplay.show_option(item.channel, itemlist)
|
autoplay.show_option(item.channel, itemlist)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
def favorites(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
patron = '(?s)short_overlay.*?<a href="([^"]+)'
|
||||||
|
patron += '.*?img.*?src="([^"]+)'
|
||||||
|
patron += '.*?title="([^"]+).*?'
|
||||||
|
matches = scrapertools.find_multiple_matches(data, patron)
|
||||||
|
for url, thumbnail, titulo in matches:
|
||||||
|
idioma = "Latino"
|
||||||
|
mtitulo = titulo + " (" + idioma + ")"
|
||||||
|
itemlist.append(item.clone(channel = item.channel,
|
||||||
|
action = "findvideos",
|
||||||
|
title = mtitulo,
|
||||||
|
fulltitle = titulo,
|
||||||
|
thumbnail = thumbnail,
|
||||||
|
url = url,
|
||||||
|
contentType="movie",
|
||||||
|
language = idioma
|
||||||
|
))
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__)
|
||||||
|
url_pagina = scrapertools.find_single_match(data, 'next" href="([^"]+)')
|
||||||
|
if url_pagina != "":
|
||||||
|
pagina = "Pagina: " + scrapertools.find_single_match(url_pagina, "page/([0-9]+)")
|
||||||
|
itemlist.append(Item(channel = item.channel, action = "peliculas", title = pagina, url = url_pagina))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(categoria):
|
||||||
logger.info()
|
logger.info()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|||||||
@@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
"id": "repelis",
|
||||||
|
"name": "Repelis",
|
||||||
|
"active": true,
|
||||||
|
"adult": false,
|
||||||
|
"language": ["lat","cast","vo"],
|
||||||
|
"thumbnail": "https://s8.postimg.cc/yem7wyfw1/repelis1.png",
|
||||||
|
"banner": "https://s8.postimg.cc/p6tzg9gjl/repelis2.png",
|
||||||
|
"categories": [
|
||||||
|
"movie"
|
||||||
|
],
|
||||||
|
"settings": [
|
||||||
|
{
|
||||||
|
"id": "filter_languages",
|
||||||
|
"type": "list",
|
||||||
|
"label": "Mostrar enlaces en idioma...",
|
||||||
|
"default": 0,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true,
|
||||||
|
"lvalues": [
|
||||||
|
"No filtrar",
|
||||||
|
"LAT",
|
||||||
|
"ESP",
|
||||||
|
"VO"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "modo_grafico",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Buscar información extra",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_newest_latino",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en Novedades - Latino",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_global_search",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en busqueda global",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_newest_peliculas",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en Novedades - Peliculas",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_newest_infantiles",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en Novedades - Infantiles",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "include_in_newest_terror",
|
||||||
|
"type": "bool",
|
||||||
|
"label": "Incluir en Novedades - terror",
|
||||||
|
"default": true,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# -*- Channel Repelis -*-
|
||||||
|
# -*- Created for Alfa-addon -*-
|
||||||
|
# -*- By the Alfa Develop Group -*-
|
||||||
|
|
||||||
|
import urllib
|
||||||
|
|
||||||
|
from channelselector import get_thumb
|
||||||
|
from channels import autoplay
|
||||||
|
from channels import filtertools
|
||||||
|
from core import httptools
|
||||||
|
from core import jsontools
|
||||||
|
from core import scrapertools
|
||||||
|
from core import servertools
|
||||||
|
from core import tmdb
|
||||||
|
from core.item import Item
|
||||||
|
from platformcode import config, logger
|
||||||
|
|
||||||
|
|
||||||
|
idio = {'es-mx': 'LAT','es-es': 'ESP','en': 'VO'}
|
||||||
|
cali = {'poor': 'SD','low': 'SD','high': 'HD'}
|
||||||
|
|
||||||
|
list_language = idio.values()
|
||||||
|
list_quality = ["SD","HD"]
|
||||||
|
list_servers = ['rapidvideo', 'streamango', 'fastplay', 'openload', 'netu', 'vidoza', 'uptobox']
|
||||||
|
|
||||||
|
|
||||||
|
__channel__='repelis'
|
||||||
|
|
||||||
|
host = "https://repelis.io"
|
||||||
|
|
||||||
|
try:
|
||||||
|
__modo_grafico__ = config.get_setting('modo_grafico', __channel__)
|
||||||
|
except:
|
||||||
|
__modo_grafico__ = True
|
||||||
|
|
||||||
|
|
||||||
|
def mainlist(item):
|
||||||
|
logger.info()
|
||||||
|
autoplay.init(item.channel, list_servers, list_quality)
|
||||||
|
itemlist = []
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Destacadas", action = "destacadas", url = host, thumbnail = get_thumb("hot", auto = True)))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Agregadas recientemente", action = "peliculas", url = host + "/explorar?page=", page=1, thumbnail = get_thumb("last", auto = True)))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Por género", action = "generos", url = host, extra = "Genero", thumbnail = get_thumb("genres", auto = True) ))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = ""))
|
||||||
|
itemlist.append(Item(channel = item.channel, title = "Buscar", action = "search", url = host + "/search?term=", thumbnail = get_thumb("search", auto = True)))
|
||||||
|
autoplay.show_option(item.channel, itemlist)
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
def destacadas(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
patron = 'Películas destacadas(.*?)</section>'
|
||||||
|
bloque = scrapertools.find_single_match(data, patron)
|
||||||
|
patron = 'href="([^"]+).*?'
|
||||||
|
patron += 'title="([^"]+).*?'
|
||||||
|
patron += 'data-src="([^"]+).*?'
|
||||||
|
patron += 'data-year="([^"]+)'
|
||||||
|
matches = scrapertools.find_multiple_matches(bloque, patron)
|
||||||
|
for scrapedurl, scrapedtitle, scrapedthumbnail, scrapedyear in matches:
|
||||||
|
scrapedtitle = scrapedtitle.replace("Película ","")
|
||||||
|
itemlist.append(Item(channel = item.channel,
|
||||||
|
action = "findvideos",
|
||||||
|
contentTitle = scrapedtitle,
|
||||||
|
infoLabels = {'year':scrapedyear},
|
||||||
|
thumbnail = host + scrapedthumbnail,
|
||||||
|
title = scrapedtitle + " (%s)" %scrapedyear,
|
||||||
|
url = host + scrapedurl
|
||||||
|
))
|
||||||
|
tmdb.set_infoLabels(itemlist)
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def peliculas(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
url = item.url
|
||||||
|
headers = [
|
||||||
|
['Content-Type', 'application/json']
|
||||||
|
]
|
||||||
|
if item.extra != "busca":
|
||||||
|
url = item.url + str(item.page)
|
||||||
|
data = httptools.downloadpage(url, post="", headers=headers).data
|
||||||
|
bloquex = scrapertools.find_single_match(data, 'window.__NUXT__={.*?movies":(.*?\])')
|
||||||
|
dict = jsontools.load(bloquex)
|
||||||
|
else:
|
||||||
|
dd = httptools.downloadpage("https://repelis.io/graph", post=jsontools.dump(item.post), headers=headers).data
|
||||||
|
dict = jsontools.load(dd)["data"]["movies"]
|
||||||
|
for datos in dict:
|
||||||
|
scrapedurl = host + "/pelicula/" + datos["slug"] + "-" + datos["id"]
|
||||||
|
scrapedtitle = datos["title"].replace("Película ","")
|
||||||
|
scrapedthumbnail = host + "/_images/posters/" + datos["poster"] + "/180x270.jpg"
|
||||||
|
scrapedyear = scrapertools.find_single_match(datos["releaseDate"],'\d{4}')
|
||||||
|
itemlist.append(Item(channel = item.channel,
|
||||||
|
action = "findvideos",
|
||||||
|
contentTitle = scrapedtitle,
|
||||||
|
infoLabels = {'year':scrapedyear},
|
||||||
|
thumbnail = scrapedthumbnail,
|
||||||
|
title = scrapedtitle + " (%s)" %scrapedyear,
|
||||||
|
url = scrapedurl
|
||||||
|
))
|
||||||
|
tmdb.set_infoLabels(itemlist)
|
||||||
|
#pagination
|
||||||
|
if len(itemlist)>0:
|
||||||
|
itemlist.append(Item(channel = item.channel,
|
||||||
|
action = "peliculas",
|
||||||
|
page = item.page + 1,
|
||||||
|
title = "Página siguiente >>",
|
||||||
|
url = item.url
|
||||||
|
))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def newest(categoria):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
item = Item()
|
||||||
|
try:
|
||||||
|
if categoria in ['peliculas','latino']:
|
||||||
|
item.url = host + "/explorar?page="
|
||||||
|
item.page=1
|
||||||
|
elif categoria == 'infantiles':
|
||||||
|
item.url = host + '/genero/animacion-WYXS9?page'
|
||||||
|
item.page = 1
|
||||||
|
elif categoria == 'terror':
|
||||||
|
item.url = host + 'genero/terror-dVbSb?page='
|
||||||
|
item.page = 1
|
||||||
|
itemlist = peliculas(item)
|
||||||
|
if "Pagina" in itemlist[-1].title:
|
||||||
|
itemlist.pop()
|
||||||
|
except:
|
||||||
|
import sys
|
||||||
|
for line in sys.exc_info():
|
||||||
|
logger.error("{0}".format(line))
|
||||||
|
return []
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def search(item, texto):
|
||||||
|
logger.info()
|
||||||
|
item.url = item.url + texto
|
||||||
|
item.extra = "busca"
|
||||||
|
item.page = 1
|
||||||
|
item.texto = texto
|
||||||
|
item.post = {"query":"\n query ($term: String) {\n movies: allMovies(search: $term) {\n id\n slug\n title\n rating\n releaseDate\n released\n poster\n nowPlaying\n }\n }\n ","variables":{"term":"%s" %texto}}
|
||||||
|
if texto != '':
|
||||||
|
return peliculas(item)
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
def generos(item):
|
||||||
|
logger.info()
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
bloque = scrapertools.find_single_match(data, "Géneros.*?</ul>")
|
||||||
|
patron = 'href="([^"]+)"'
|
||||||
|
patron += '>([^<]+)'
|
||||||
|
matches = scrapertools.find_multiple_matches(bloque, patron)
|
||||||
|
for url, titulo in matches:
|
||||||
|
itemlist.append(Item(channel = item.channel,
|
||||||
|
action = "peliculas",
|
||||||
|
title = titulo,
|
||||||
|
url = host + url + "?page=",
|
||||||
|
page = 1
|
||||||
|
))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def findvideos(item):
|
||||||
|
itemlist = []
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
bloque = scrapertools.find_single_match(data, ',"mirrors":(.*?\])')
|
||||||
|
if bloque == "[]":
|
||||||
|
return []
|
||||||
|
dict = jsontools.load(bloque)
|
||||||
|
urlx = httptools.downloadpage(host + dict[0]["url"]) #Para que pueda saltar el cloudflare, se tiene que descargar la página completa
|
||||||
|
for datos in dict:
|
||||||
|
url1 = httptools.downloadpage(host + datos["url"], follow_redirects=False, only_headers=True).headers.get("location", "")
|
||||||
|
titulo = "Ver en: %s (" + cali[datos["quality"]] + ") (" + idio[datos["audio"]] + ")"
|
||||||
|
text_color = "white"
|
||||||
|
if "youtube" in url1:
|
||||||
|
titulo = "Ver trailer: %s"
|
||||||
|
text_color = "yellow"
|
||||||
|
itemlist.append(
|
||||||
|
item.clone(channel = item.channel,
|
||||||
|
action = "play",
|
||||||
|
language = idio[datos["audio"]],
|
||||||
|
quality = cali[datos["quality"]],
|
||||||
|
title = titulo,
|
||||||
|
url = url1
|
||||||
|
))
|
||||||
|
itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize())
|
||||||
|
itemlist.sort(key=lambda it: (it.language, it.server))
|
||||||
|
tmdb.set_infoLabels(itemlist, __modo_grafico__)
|
||||||
|
# Requerido para FilterTools
|
||||||
|
itemlist = filtertools.get_links(itemlist, item, list_language)
|
||||||
|
|
||||||
|
# Requerido para AutoPlay
|
||||||
|
|
||||||
|
autoplay.start(itemlist, item)
|
||||||
|
|
||||||
|
if itemlist:
|
||||||
|
itemlist.append(Item(channel = item.channel))
|
||||||
|
itemlist.append(item.clone(channel="trailertools", title="Buscar Tráiler", action="buscartrailer", context="",
|
||||||
|
text_color="magenta"))
|
||||||
|
# Opción "Añadir esta película a la biblioteca de KODI"
|
||||||
|
if item.extra != "library":
|
||||||
|
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,
|
||||||
|
contentTitle = item.contentTitle
|
||||||
|
))
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def play(item):
|
||||||
|
item.thumbnail = item.contentThumbnail
|
||||||
|
return [item]
|
||||||
@@ -242,8 +242,9 @@ def downloadpage(url, post=None, headers=None, timeout=None, follow_redirects=Tr
|
|||||||
server_cloudflare = "cloudflare"
|
server_cloudflare = "cloudflare"
|
||||||
|
|
||||||
is_channel = inspect.getmodule(inspect.currentframe().f_back)
|
is_channel = inspect.getmodule(inspect.currentframe().f_back)
|
||||||
# error 4xx o 5xx se lanza excepcion
|
# error 4xx o 5xx se lanza excepcion (menos para servidores)
|
||||||
# response["code"] = 400
|
# response["code"] = 400 # linea de código para probar
|
||||||
|
is_channel = str(is_channel).replace("/servers/","\\servers\\") # Para sistemas operativos diferente a Windows la ruta cambia
|
||||||
if type(response["code"]) == int and "\\servers\\" not in str(is_channel):
|
if type(response["code"]) == int and "\\servers\\" not in str(is_channel):
|
||||||
if response["code"] > 399 and (server_cloudflare == "cloudflare" and response["code"] != 503):
|
if response["code"] > 399 and (server_cloudflare == "cloudflare" and response["code"] != 503):
|
||||||
raise WebErrorException(urlparse.urlparse(url)[1])
|
raise WebErrorException(urlparse.urlparse(url)[1])
|
||||||
|
|||||||
@@ -7,22 +7,16 @@ from platformcode import config, logger
|
|||||||
|
|
||||||
def test_video_exists(page_url):
|
def test_video_exists(page_url):
|
||||||
logger.info("(page_url='%s')" % page_url)
|
logger.info("(page_url='%s')" % page_url)
|
||||||
try:
|
response = httptools.downloadpage(page_url)
|
||||||
response = httptools.downloadpage(page_url)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
if response.code == 404:
|
if response.code == 404:
|
||||||
return False, config.get_localized_string(70449) % "RapidVideo"
|
return False, config.get_localized_string(70449) % "RapidVideo"
|
||||||
if not response.data or "urlopen error [Errno 1]" in str(response.code):
|
if not response.data or "urlopen error [Errno 1]" in str(response.code):
|
||||||
from platformcode import config
|
|
||||||
if config.is_xbmc():
|
if config.is_xbmc():
|
||||||
return False, config.get_localized_string(70302) % "RapidVideo"
|
return False, config.get_localized_string(70302) % "RapidVideo"
|
||||||
elif config.get_platform() == "plex":
|
elif config.get_platform() == "plex":
|
||||||
return False, config.get_localized_string(70303) % "RapidVideo"
|
return False, config.get_localized_string(70303) % "RapidVideo"
|
||||||
elif config.get_platform() == "mediaserver":
|
elif config.get_platform() == "mediaserver":
|
||||||
return False, config.get_localized_string(70304) % "RapidVideo"
|
return False, config.get_localized_string(70304) % "RapidVideo"
|
||||||
|
|
||||||
if "Object not found" in response.data:
|
if "Object not found" in response.data:
|
||||||
return False, config.get_localized_string(70449) % "RapidVideo"
|
return False, config.get_localized_string(70449) % "RapidVideo"
|
||||||
if response.code == 500:
|
if response.code == 500:
|
||||||
|
|||||||
Reference in New Issue
Block a user