# -*- 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