# -*- coding: utf-8 -*- # -*- Channel PeliculasHD -*- # -*- Created for Alfa-addon -*- # -*- By the Alfa Develop Group -*- import re import urllib import base64 from channelselector import get_thumb from core import httptools from core import jsontools from core import scrapertools from core import servertools from core import tmdb from lib import jsunpack from core.item import Item from channels import filtertools from channels import autoplay from platformcode import config, logger IDIOMAS = {'Latino': 'Latino', 'Español': 'Castellano', 'VOSE': 'VOSE'} list_language = IDIOMAS.values() list_quality = [] list_servers = [ 'directo', 'openload', 'rapidvideo' ] __comprueba_enlaces__ = config.get_setting('comprueba_enlaces', 'peliculashd') __comprueba_enlaces_num__ = config.get_setting('comprueba_enlaces_num', 'peliculashd') host = 'https://peliculashd.site/' def mainlist(item): logger.info() autoplay.init(item.channel, list_servers, list_quality) itemlist = [] itemlist.append(Item(channel=item.channel, title='Peliculas', action='menu_movies', thumbnail= get_thumb('movies', auto=True))) itemlist.append(Item(channel=item.channel, title='Series', url=host+'/genero/serie', action='list_all', type='tvshows', thumbnail= get_thumb('tvshows', auto=True))) itemlist.append(Item(channel=item.channel, title='Anime', url=host + '/genero/anime', action='list_all', type='tvshows', thumbnail=get_thumb('anime', auto=True))) itemlist.append( Item(channel=item.channel, title='Telenovelas', url=host + '/genero/telenovelas-teleseries', action='list_all', type='tvshows', thumbnail=get_thumb('telenovelas', auto=True))) itemlist.append( item.clone(title="Buscar", action="search", url=host + '?s=', thumbnail=get_thumb("search", auto=True), extra='movie')) autoplay.show_option(item.channel, itemlist) return itemlist def menu_movies(item): logger.info() itemlist=[] itemlist.append(Item(channel=item.channel, title='Todas', url=host + 'movies', action='list_all', thumbnail=get_thumb('all', auto=True), type='movies')) itemlist.append(Item(channel=item.channel, title='Genero', action='section', thumbnail=get_thumb('genres', auto=True), type='movies')) itemlist.append(Item(channel=item.channel, title='Por Año', action='section', thumbnail=get_thumb('year', auto=True), type='movies')) 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 get_language(lang_data): logger.info() language = [] lang_list = scrapertools.find_multiple_matches(lang_data, '/flags/(.*?).png\)') for lang in lang_list: if lang == 'en': lang = 'vose' if lang not in language: language.append(lang) return language def section(item): logger.info() itemlist=[] duplicados=[] full_data = get_source(host+'/'+item.type) if 'Genero' in item.title: data = scrapertools.find_single_match(full_data, 'Generos(.*?)') elif 'Año' in item.title: data = scrapertools.find_single_match(full_data, '

Busqueda por Año

(.*?)') patron = '([^<]+)<' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedtitle in matches: title = scrapedtitle plot='' title = scrapedtitle url = scrapedurl if title not in duplicados and title.lower() != 'proximamente': itemlist.append(Item(channel=item.channel, url=url, title=title, plot=plot, action='list_all', type=item.type)) duplicados.append(title) return itemlist def list_all(item): logger.info() itemlist = [] data = get_source(item.url) if item.type == 'movies': patron = '
\s?([^.*?' patron += '"quality">([^<]+)<\/div>\s?.*?.*?([^<]+)