From bfc1055e4f24223116acb5b755392807e58b8379 Mon Sep 17 00:00:00 2001 From: Intel1 Date: Wed, 25 Jul 2018 11:57:28 -0500 Subject: [PATCH] Actualizados 1 pelisr: nuevo canal flashx: fix --- plugin.video.alfa/channels/pelisr.json | 79 ++++++ plugin.video.alfa/channels/pelisr.py | 366 +++++++++++++++++++++++++ plugin.video.alfa/servers/flashx.py | 8 +- 3 files changed, 449 insertions(+), 4 deletions(-) create mode 100644 plugin.video.alfa/channels/pelisr.json create mode 100644 plugin.video.alfa/channels/pelisr.py diff --git a/plugin.video.alfa/channels/pelisr.json b/plugin.video.alfa/channels/pelisr.json new file mode 100644 index 00000000..7ea9b0fc --- /dev/null +++ b/plugin.video.alfa/channels/pelisr.json @@ -0,0 +1,79 @@ +{ +"id": "pelisr", + "name": "PelisR", + "active": true, + "adult": false, + "language": ["lat", "cast", "vose"], + "thumbnail": "https://s22.postimg.cc/gcp2jqbs1/pelisr.png", + "banner": "", + "categories": [ + "movie", + "tvshow", + "direct" + ], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "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", + "Latino", + "Castellano", + "VOSE" + ] + }, + { + "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": "comprueba_enlaces", + "type": "bool", + "label": "Verificar si los enlaces existen", + "default": false, + "enabled": true, + "visible": true + }, + { + "id": "comprueba_enlaces_num", + "type": "list", + "label": "Número de enlaces a verificar", + "default": 1, + "enabled": true, + "visible": "eq(-1,true)", + "lvalues": [ "5", "10", "15", "20" ] + } + ] +} diff --git a/plugin.video.alfa/channels/pelisr.py b/plugin.video.alfa/channels/pelisr.py new file mode 100644 index 00000000..9a45ffb3 --- /dev/null +++ b/plugin.video.alfa/channels/pelisr.py @@ -0,0 +1,366 @@ +# -*- coding: utf-8 -*- +# -*- Channel PoseidonHD -*- +# -*- 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 = {'mx': 'Latino', 'dk':'Latino', 'es': 'Castellano', 'en': 'VOSE', 'gb':'VOSE'} +list_language = IDIOMAS.values() + +list_quality = ['360P', '480P', '720P', '1080P'] + +list_servers = [ + 'directo', + 'openload', + 'rapidvideo' +] + +__comprueba_enlaces__ = config.get_setting('comprueba_enlaces', 'poseidonhd') +__comprueba_enlaces_num__ = config.get_setting('comprueba_enlaces_num', 'poseidonhd') + +host = 'https://pelisr.com/' + +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+'tvshows', action='list_all', type='tvshows', + thumbnail= get_thumb('tvshows', 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 = [] + logger.debug(lang_data) + 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=[] + data = get_source(host+'/'+item.type) + if 'Genero' in item.title: + patron = '
  • (.*?)/i>' + elif 'Año' in item.title: + patron = '
  • (.*?)' + elif 'Calidad' in item.title: + patron = 'menu-item-object-dtquality menu-item-\d+>(.*?)' + + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedtitle in matches: + title = scrapedtitle + plot='' + if 'Genero' in item.title: + quantity = scrapertools.find_single_match(scrapedtitle,' (.*?)<') + title = scrapertools.find_single_match(scrapedtitle,'(.*?)
    (.*?).*?quality>(.*?)' + patron += '<\/div>.*?<\/h3>(.*?)<\/span><\/div>.*?flags(.*?)metadata' + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedthumbnail, scrapedtitle, quality, scrapedurl, year, lang_data in matches: + + + title = '%s [%s] [%s]' % (scrapedtitle, year, quality) + contentTitle = scrapedtitle + thumbnail = scrapedthumbnail + url = scrapedurl + language = get_language(lang_data) + + itemlist.append(item.clone(action='findvideos', + title=title, + url=url, + thumbnail=thumbnail, + contentTitle=contentTitle, + language=language, + quality=quality, + infoLabels={'year':year})) + + elif item.type == 'tvshows': + patron = '
    (.*?).*?' + patron += '.*?<\/h3>(.*?)<\/span><\/div>' + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedthumbnail, scrapedtitle, scrapedurl, year in matches: + title = scrapedtitle + contentSerieName = scrapedtitle + thumbnail = scrapedthumbnail + url = scrapedurl + + itemlist.append(item.clone(action='seasons', + title=title, + url=url, + thumbnail=thumbnail, + contentSerieName=contentSerieName, + infoLabels={'year':year})) + + tmdb.set_infoLabels(itemlist, seekTmdb=True) + # Paginación + + #url_next_page = scrapertools.find_single_match(data,"]+)>