From 07147d7e4817452124a00270b1117819455c3b44 Mon Sep 17 00:00:00 2001 From: Alfa-beto <30815244+Alfa-beto@users.noreply.github.com> Date: Thu, 25 Oct 2018 09:58:06 -0300 Subject: [PATCH] - Repelis.live: Nuevo canal --- plugin.video.alfa/channels/repelislive.json | 55 +++++ plugin.video.alfa/channels/repelislive.py | 246 ++++++++++++++++++++ 2 files changed, 301 insertions(+) create mode 100644 plugin.video.alfa/channels/repelislive.json create mode 100644 plugin.video.alfa/channels/repelislive.py diff --git a/plugin.video.alfa/channels/repelislive.json b/plugin.video.alfa/channels/repelislive.json new file mode 100644 index 00000000..7b8d8ac7 --- /dev/null +++ b/plugin.video.alfa/channels/repelislive.json @@ -0,0 +1,55 @@ +{ + "id": "repelislive", + "name":"Repelis.live", + "thumbnail":"https://i.postimg.cc/j5ndjr3j/repelislive.png", + "banner":"", + "active": true, + "adult": false, + "language": ["cast", "lat"], + "version": 1, + "categories": [ + "movie", + "vos" + ], + "settings": [ + { + "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 + }, + { + "id": "filter_languages", + "type": "list", + "label": "Mostrar enlaces en idioma...", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "No filtrar", + "LAT", + "CAST", + "VOSE" + ] + } + ] + +} diff --git a/plugin.video.alfa/channels/repelislive.py b/plugin.video.alfa/channels/repelislive.py new file mode 100644 index 00000000..af733fb7 --- /dev/null +++ b/plugin.video.alfa/channels/repelislive.py @@ -0,0 +1,246 @@ +# -*- coding: utf-8 -*- +# -*- Channel Repelis.live -*- +# -*- Created for Alfa-addon -*- +# -*- By the Alfa Develop Group -*- + +import re +import urllib +import urlparse + +from channelselector import get_thumb +from core import httptools +from core import jsontools +from core import scrapertools +from core import servertools +from core.item import Item +from platformcode import config, logger +from core import tmdb +from channels import filtertools +from channels import autoplay + +IDIOMAS = {'Latino': 'LAT', 'Castellano':'CAST', 'Subtitulado': 'VOSE'} +list_language = IDIOMAS.values() +list_quality = [] +list_servers = ['openload', 'streamango', 'rapidvideo', 'netutv'] + +host = "http://repelis.live/" + +def mainlist(item): + logger.info() + + autoplay.init(item.channel, list_servers, list_quality) + itemlist = list() + + itemlist.append( + Item(channel=item.channel, + title="Ultimas", + action="list_all", + url=host, + thumbnail=get_thumb("last", auto=True))) + + itemlist.append( + Item(channel=item.channel, + title="Castellano", + action="list_all", + url=host+'pelis-castellano/', + thumbnail=get_thumb("cast", auto=True))) + + itemlist.append( + Item(channel=item.channel, + title="Latino", + action="list_all", + url=host+'pelis-latino/', + thumbnail=get_thumb("lat", auto=True))) + + itemlist.append( + Item(channel=item.channel, + title="VOSE", + action="list_all", + url=host+'pelis-subtitulado/', + thumbnail=get_thumb("vose", auto=True))) + + itemlist.append( + Item(channel=item.channel, + title="Generos", + action="categories", + url=host, + thumbnail=get_thumb('genres', auto=True) + )) + + itemlist.append( + Item(channel=item.channel, + title="Por Año", + action="categories", + url=host, + thumbnail=get_thumb('year', 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) + + return itemlist + +def get_source(url): + logger.info() + data = httptools.downloadpage(url).data + data = re.sub(r'\n|\r|\t| |
|\s{2,}', "", data) + return data + + +def categories(item): + logger.info() + itemlist = [] + + data = get_source(item.url) + if item.title != 'Generos': + patron = '' + else: + data = scrapertools.find_single_match(data, 'Categories') + patron = '([^<]+)' + + matches = re.compile(patron, re.DOTALL).findall(data) + + for url, title in matches: + itemlist.append(Item(channel=item.channel, + action="list_all", + title=title, + url=url + )) + return itemlist + + + + + +def list_all(item): + logger.info() + itemlist = [] + + data = get_source(item.url) + + if item.title == 'Buscar': + pattern = '
.*? 0 and item.extra != 'findvideos': + itemlist.append(Item(channel=item.channel, title='[COLOR yellow]Añadir esta pelicula a la videoteca[/COLOR]', + url=item.url, action="add_pelicula_to_library", extra="findvideos", + contentTitle=item.contentTitle + )) + + return itemlist + +def search(item, texto): + logger.info() + texto = texto.replace(" ", "+") + try: + if texto != '': + item.url += texto + return list_all(item) + else: + return [] + except: + import sys + for line in sys.exc_info(): + logger.error("%s" % line) + return [] + +def newest(category): + logger.info() + item = Item() + try: + if category == 'peliculas': + item.url = host + elif category == 'infantiles': + item.url = host + 'category/animacion' + elif category == 'terror': + item.url = host + 'category/terror' + itemlist = list_all(item) + + if itemlist[-1].title == '>> Página siguiente': + itemlist.pop() + except: + import sys + for line in sys.exc_info(): + logger.error("%s" % line) + return [] + + return itemlist