From 8e61a74e036e7f6a6455b61d877206f8b142de95 Mon Sep 17 00:00:00 2001 From: Alfa-beto <30815244+Alfa-beto@users.noreply.github.com> Date: Wed, 27 Feb 2019 12:34:21 -0300 Subject: [PATCH] Correcciones y Novedades MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Correcciones - CineCalidad: Corrección por cambio de estructura - DoomTV: Corrección por cambio de estructura + Autoplay - DosPelis: Corrección por cambio de estructura - SeriesBlanco: Corrección para seccion generos Novedades -Pelix: Nuevo canal --- plugin.video.alfa/channels/cinecalidad.py | 15 +- plugin.video.alfa/channels/doomtv.py | 42 ++- plugin.video.alfa/channels/dospelis.json | 2 +- plugin.video.alfa/channels/dospelis.py | 31 +- plugin.video.alfa/channels/pelix.json | 78 +++++ plugin.video.alfa/channels/pelix.py | 352 +++++++++++++++++++++ plugin.video.alfa/channels/seriesblanco.py | 47 ++- 7 files changed, 529 insertions(+), 38 deletions(-) create mode 100644 plugin.video.alfa/channels/pelix.json create mode 100644 plugin.video.alfa/channels/pelix.py diff --git a/plugin.video.alfa/channels/cinecalidad.py b/plugin.video.alfa/channels/cinecalidad.py index ec18bc95..2c11d1ad 100644 --- a/plugin.video.alfa/channels/cinecalidad.py +++ b/plugin.video.alfa/channels/cinecalidad.py @@ -130,7 +130,7 @@ def anyos(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data - patron = '([^<]+)([^<]+)<\/a>' + patron = '' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedtitle in matches: url = urlparse.urljoin(item.url, scrapedurl) @@ -206,8 +206,8 @@ def peliculas(item): data = httptools.downloadpage(item.url).data - patron = '
.*?|\s{2,}', "", data) - logger.debug(data) return data def lista(item): @@ -98,9 +99,9 @@ def lista(item): for scrapedurl, quality, scrapedthumbnail, scrapedtitle, plot in matches[first:last]: - url = 'http:'+scrapedurl - thumbnail = scrapedthumbnail - filtro_thumb = scrapedthumbnail.replace("https://image.tmdb.org/t/p/w185", "") + url = host+scrapedurl + thumbnail = 'https:'+scrapedthumbnail.strip() + filtro_thumb = thumbnail.replace("https://image.tmdb.org/t/p/w185", "") filtro_list = {"poster_path": filtro_thumb.strip()} filtro_list = filtro_list.items() title = scrapedtitle @@ -144,7 +145,7 @@ def seccion(item): matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedtitle in matches: - url = 'http:'+ scrapedurl + url = host+scrapedurl title = scrapedtitle thumbnail = '' if url not in duplicado: @@ -196,22 +197,36 @@ def findvideos(item): itemlist = [] data = get_source(item.url) - patron = 'id="(tab\d+)">
.*?src="([^"]+)"' matches = re.compile(patron, re.DOTALL).findall(data) for option, urls in matches: + language = 'Latino' if 'http' not in urls: urls = 'https:'+urls + if not config.get_setting('unify'): + title = ' [%s]' % language + else: + title = '%s' new_item = Item( channel=item.channel, url=urls, - title=item.title, + title= '%s'+ title, contentTitle=item.title, action='play', + language = IDIOMAS[language], + infoLabels = item.infoLabels ) itemlist.append(new_item) - itemlist = servertools.get_servers_itemlist(itemlist) + itemlist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize()) + + # Requerido para FilterTools + + itemlist = filtertools.get_links(itemlist, item, list_language) + + # Requerido para AutoPlay + + autoplay.start(itemlist, item) if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findvideos': itemlist.append( @@ -223,4 +238,5 @@ def findvideos(item): contentTitle=item.contentTitle, )) + return itemlist diff --git a/plugin.video.alfa/channels/dospelis.json b/plugin.video.alfa/channels/dospelis.json index 13130b10..b311ee3b 100644 --- a/plugin.video.alfa/channels/dospelis.json +++ b/plugin.video.alfa/channels/dospelis.json @@ -4,7 +4,7 @@ "active": true, "adult": false, "language": ["lat", "cast"], - "thumbnail": "https://www.dospelis.com/wp-content/uploads/2018/07/dospelislogo.png", + "thumbnail": "https://www.dospelis.net/wp-content/uploads/2019/02/logodospelisamor.png", "banner": "", "categories": [ "movie", diff --git a/plugin.video.alfa/channels/dospelis.py b/plugin.video.alfa/channels/dospelis.py index 4b02891a..ae332456 100644 --- a/plugin.video.alfa/channels/dospelis.py +++ b/plugin.video.alfa/channels/dospelis.py @@ -90,11 +90,11 @@ def section(item): logger.info() itemlist=[] duplicados=[] - data = get_source(host+'/'+item.type) + data = get_source(host+item.type) if 'Genero' in item.title: - patron = '
  • (.*?)/i>' + patron = '(.*?)/i>' elif 'Año' in item.title: - patron = '
  • ([^<]+)' + patron = '
  • ([^<]+)' matches = re.compile(patron, re.DOTALL).findall(data) @@ -102,7 +102,7 @@ def section(item): title = scrapedtitle plot='' if 'Genero' in item.title: - quantity = scrapertools.find_single_match(scrapedtitle,' (.*?)<') + quantity = scrapertools.find_single_match(scrapedtitle,'(.*?)<') title = scrapertools.find_single_match(scrapedtitle,'(.*?)
    .?([^.*?' - patron +='"quality">([^<]+)<\/div>.?.*?' - patron +='<\/h3>.?([^"]+)<\/span><\/div>.*?"flags"(.*?)metadata' + patron = '.?.*?' + patron += 'quality>([^<]+)<.*?]+)>.*?<\/h3>([^<]+)<.*?flags(.*?)metadata' matches = re.compile(patron, re.DOTALL).findall(data) @@ -148,8 +147,8 @@ def list_all(item): infoLabels={'year':year})) elif item.type == 'tvshows': - patron = '
    .?
    .?') + url_next_page = scrapertools.find_single_match(data,']+)>') if url_next_page: itemlist.append(item.clone(title="Siguiente >>", url=url_next_page, action='list_all')) @@ -180,7 +179,7 @@ def seasons(item): itemlist=[] data=get_source(item.url) - patron='Temporada.?\d+' + patron='title>Temporada.?(\d+)' matches = re.compile(patron, re.DOTALL).findall(data) infoLabels = item.infoLabels @@ -214,7 +213,7 @@ def episodesxseasons(item): itemlist = [] data=get_source(item.url) - patron='class="numerando">%s - (\d+)
    .?
    .?.?]+)>([^<]+)<' % item.infoLabels['season'] matches = re.compile(patron, re.DOTALL).findall(data) infoLabels = item.infoLabels @@ -236,12 +235,15 @@ def findvideos(item): logger.info() itemlist = [] data = get_source(item.url) - patron = 'id="option-(\d+)".*?rptss" src="([^"]+)" frameborder' + patron = 'id=option-(\d+).*?src=([^ ]+) frameborder' matches = re.compile(patron, re.DOTALL).findall(data) lang='' for option, scrapedurl in matches: lang = scrapertools.find_single_match(data, 'href=#option-%s>.*?/flags/(.*?).png' % option) quality = '' + if 'goo.gl' in scrapedurl: + new_data = httptools.downloadpage(scrapedurl, follow_redirects=False).headers + scrapedurl = new_data['location'] if lang not in IDIOMAS: lang = 'en' title = '%s %s' @@ -291,8 +293,7 @@ def search_results(item): itemlist=[] data=get_source(item.url) - patron = '
    .*?([^.*?meta.*?' - patron += '"year">([^<]+)<(.*?)

    ([^<]+)<\/p>' + patron = '

    .*?]+)>.*?year>([^<]+)<(.*?)

    ([^<]+)<\/p>' matches = re.compile(patron, re.DOTALL).findall(data) for scrapedurl, scrapedthumb, scrapedtitle, year, lang_data, scrapedplot in matches: diff --git a/plugin.video.alfa/channels/pelix.json b/plugin.video.alfa/channels/pelix.json new file mode 100644 index 00000000..56e91975 --- /dev/null +++ b/plugin.video.alfa/channels/pelix.json @@ -0,0 +1,78 @@ +{ +"id": "pelix", + "name": "Pelix", + "active": true, + "adult": false, + "language": ["lat", "cast"], + "thumbnail": "https://pelix.tv/build/images/logo.png", + "banner": "", + "categories": [ + "movie", + "tvshow" + ], + "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/pelix.py b/plugin.video.alfa/channels/pelix.py new file mode 100644 index 00000000..ee58bd00 --- /dev/null +++ b/plugin.video.alfa/channels/pelix.py @@ -0,0 +1,352 @@ +# -*- coding: utf-8 -*- +# -*- Channel Pelix -*- +# -*- 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 = {'6': 'Latino', '7': 'Castellano'} +list_language = IDIOMAS.values() +CALIDADES = {'1': '1080p', '3': '720p', '4':'720p'} +list_quality = CALIDADES.values() + +list_servers = [ + 'openload', + 'streamango', + 'fastplay', + 'rapidvideo', + 'netutv' +] + +__comprueba_enlaces__ = config.get_setting('comprueba_enlaces', 'pelix') +__comprueba_enlaces_num__ = config.get_setting('comprueba_enlaces_num', 'pelix') + +host = 'https://pelix.tv/' + +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), page=0)) + itemlist.append(Item(channel=item.channel, title='Series', url=host+'home/genero/5', action='list_all', + type='tvshows', thumbnail= get_thumb('tvshows', auto=True), page=0)) + itemlist.append( + item.clone(title="Buscar", action="search", url=host + 'movies/headserach', 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='Ultimas', url=host, path='home/newest?show=', action='list_all', + thumbnail=get_thumb('last', auto=True), type='movies', page=0)) + + #itemlist.append(Item(channel=item.channel, title='Mas Vistas', url=host, path='home/views?show=', action='list_all', + # thumbnail=get_thumb('all', auto=True), type='movies', page=0)) + + 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=[] + data = get_source(host) + if 'Genero' in item.title: + data = scrapertools.find_single_match(data, '
    Género(.*?)') + elif 'Año' in item.title: + data = scrapertools.find_single_match(data, 'Año(.*?)') + + patron = '([^<]+)' + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedtitle in matches: + itemlist.append(Item(channel=item.channel, url=scrapedurl, title=scrapedtitle, action='list_all', + type=item.type, page=0)) + + return itemlist + + +def list_all(item): + logger.info() + import urllib + itemlist = [] + if item.page == 0: + data = get_source(item.url+item.path) + else: + post = {'page': str(item.page)} + post = urllib.urlencode(post) + data = httptools.downloadpage(host+'home/%sAjax/%s' % ('newest', str(item.page)), post=post).data + data = re.sub(r'\n|\r|\t| |
    |\s{2,}', "", data) + + patron = '

    .*?.*? 0: + itemlist.append( + Item(channel=item.channel, title='[COLOR yellow]Añadir esta serie a la videoteca[/COLOR]', url=item.url, + action="add_serie_to_library", extra="episodios", contentSerieName=item.contentSerieName)) + + return itemlist + +def episodios(item): + logger.info() + itemlist = [] + templist = seasons(item) + for tempitem in templist: + itemlist += episodesxseasons(tempitem) + + return itemlist + +def episodesxseasons(item): + logger.info() + + itemlist = [] + duplicados = [] + data=get_source(item.url) + patron='data-id="(\d+)" season="%s" id_lang="(\d+)" id_movies_types="\d".*?' \ + 'block;">([^<]+)' % item.infoLabels['season'] + matches = re.compile(patron, re.DOTALL).findall(data) + + infoLabels = item.infoLabels + + for scrapedepisode, lang, scrapedtitle in matches: + + infoLabels['episode'] = scrapedepisode + url = item.url + title = '%sx%s - %s' % (infoLabels['season'], infoLabels['episode'], scrapedtitle) + + if scrapedepisode not in duplicados: + itemlist.append(Item(channel=item.channel, title= title, url=url, action='findvideos', infoLabels=infoLabels)) + duplicados.append(scrapedepisode) + + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + + return itemlist + + +def findvideos(item): + logger.info() + + itemlist = [] + + data = get_source(item.url) + if 'episode="0" season="0"' not in data and item.contentType != 'episode': + item.contentSerieName = item.contentTitle + item.contentTitle = None + item.contentType = None + item.infoLabels = None + tmdb.set_infoLabels_item(item, seekTmdb=True) + return seasons(item) + + if 'episode="0" season="0"' not in data: + season = item.infoLabels['season'] + episode = item.infoLabels['episode'] + else: + season = '0' + episode = '0' + + patron = ' 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(" ", "+") + post = 'search=%s' % texto + item.post = post + item.url = item.url + + if texto != '': + return search_results(item) + else: + return [] + +def search_results(item): + logger.info() + + itemlist=[] + + headers = {'Referer': host, 'X-Requested-With': 'XMLHttpRequest'} + data = httptools.downloadpage(item.url, headers=headers, post=item.post).data + data = re.sub(r'\n|\r|\t| |
    |\s{2,}', "", data) + patron = 'class="results\d+".*?([^<]+)<' + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedthumb, scrapedtitle in matches: + + if '(' in scrapedtitle: + title = scrapertools.find_single_match(scrapedtitle, '(.*?)\(').strip() + year = scrapertools.find_single_match(scrapedtitle, '\((\d+)\)') + else: + title = scrapedtitle + year = '-' + url = scrapedurl + thumbnail = scrapedthumb + + new_item=Item(channel=item.channel, title=title, url=url, thumbnail=thumbnail, + action='findvideos', infoLabels={'year':year}) + + itemlist.append(new_item) + + return itemlist + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + item.type = 'movies' + item.page = 0 + if categoria in ['peliculas']: + item.url = host + 'home/newest?show=' + elif categoria == 'infantiles': + item.url = host + 'home/genero/54' + elif categoria == 'terror': + item.url = host + 'home/genero/49' + itemlist = list_all(item) + if itemlist[-1].title == 'Siguiente >>': + itemlist.pop() + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] + + return itemlist diff --git a/plugin.video.alfa/channels/seriesblanco.py b/plugin.video.alfa/channels/seriesblanco.py index 0eed39d9..aebecc79 100644 --- a/plugin.video.alfa/channels/seriesblanco.py +++ b/plugin.video.alfa/channels/seriesblanco.py @@ -114,6 +114,49 @@ def list_all(item): )) return itemlist +def list_from_genre(item): + logger.info() + + itemlist = [] + data = get_source(item.url) + contentSerieName = '' + + patron = '