diff --git a/plugin.video.alfa/channels/allcalidad.py b/plugin.video.alfa/channels/allcalidad.py index 6c5930d8..acce6a51 100755 --- a/plugin.video.alfa/channels/allcalidad.py +++ b/plugin.video.alfa/channels/allcalidad.py @@ -124,12 +124,12 @@ def peliculas(item): logger.info() itemlist = [] data = httptools.downloadpage(item.url).data - patron = '(?s)short_overlay.*?([^<]+)').strip() + datapostid = scrapertools.find_single_match(datos, 'data-postid="([^"]+)') + thumbnail = scrapertools.find_single_match(datos, 'img w.*?src="([^"]+)') post = 'action=get_movie_details&postID=%s' %datapostid data1 = httptools.downloadpage(host + "wp-admin/admin-ajax.php", post=post).data idioma = "Latino" diff --git a/plugin.video.alfa/channels/cine24h.json b/plugin.video.alfa/channels/cine24h.json new file mode 100644 index 00000000..b679159c --- /dev/null +++ b/plugin.video.alfa/channels/cine24h.json @@ -0,0 +1,63 @@ +{ + "id": "cine24h", + "name": "Cine24H", + "active": true, + "adult": false, + "language": ["lat", "cast", "eng"], + "fanart": "https://i.postimg.cc/WpqD2n77/cine24bg.jpg", + "thumbnail": "https://cine24h.net/wp-content/uploads/2018/06/cine24hv2.png", + "banner": "", + "categories": [ + "movie", + "tvshow", + "vose" + ], + "settings": [ + { + "id": "filter_languages", + "type": "list", + "label": "Mostrar enlaces en idioma...", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "No filtrar", + "Latino", + "Castellano", + "English" + ] + }, + { + "id": "modo_grafico", + "type": "bool", + "label": "Buscar información extra", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "perfil", + "type": "list", + "label": "Perfil de color", + "default": 3, + "enabled": true, + "visible": true, + "lvalues": [ + "Sin color", + "Perfil 5", + "Perfil 4", + "Perfil 3", + "Perfil 2", + "Perfil 1" + ] + }, + { + "id": "orden_episodios", + "type": "bool", + "label": "Mostrar los episodios de las series en orden descendente", + "default": false, + "enabled": true, + "visible": true + } + ] +} diff --git a/plugin.video.alfa/channels/cine24h.py b/plugin.video.alfa/channels/cine24h.py new file mode 100644 index 00000000..e5edfed9 --- /dev/null +++ b/plugin.video.alfa/channels/cine24h.py @@ -0,0 +1,382 @@ +# -*- coding: utf-8 -*- +# -*- Channel CanalPelis -*- +# -*- Created for Alfa-addon -*- +# -*- By the Alfa Develop Group -*- + +import re +import sys +import urlparse + +from channels import autoplay +from channels import filtertools +from core import httptools +from core import scrapertools +from core import servertools +from core.item import Item +from core import channeltools +from core import tmdb +from platformcode import config, logger +from channelselector import get_thumb + +__channel__ = "cine24h" + +host = "https://cine24h.net/" + +try: + __modo_grafico__ = config.get_setting('modo_grafico', __channel__) + __perfil__ = int(config.get_setting('perfil', __channel__)) +except: + __modo_grafico__ = True + __perfil__ = 0 + +# Fijar perfil de color +perfil = [['0xFFFFE6CC', '0xFFFFCE9C', '0xFF994D00', '0xFFFE2E2E', '0xFFFFD700'], + ['0xFFA5F6AF', '0xFF5FDA6D', '0xFF11811E', '0xFFFE2E2E', '0xFFFFD700'], + ['0xFF58D3F7', '0xFF2E9AFE', '0xFF2E64FE', '0xFFFE2E2E', '0xFFFFD700']] +if __perfil__ < 3: + color1, color2, color3, color4, color5 = perfil[__perfil__] +else: + color1 = color2 = color3 = color4 = color5 = "" + +headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'], + ['Referer', host]] + + +parameters = channeltools.get_channel_parameters(__channel__) +fanart_host = parameters['fanart'] +thumbnail_host = parameters['thumbnail'] + +IDIOMAS = {'Latino': 'LAT', 'Castellano': 'CAST'} +list_language = IDIOMAS.values() +list_quality = [] +list_servers = ['rapidvideo', 'streamango', 'openload', 'streamcherry'] + + +def mainlist(item): + logger.info() + autoplay.init(item.channel, list_servers, list_quality) + itemlist = [item.clone(title="Peliculas", action="menumovies", text_blod=True, + viewcontent='movies', viewmode="movie_with_plot", thumbnail=get_thumb('movies', auto=True)), + + item.clone(title="Series", action="series", extra='serie', url=host + 'series/', + viewmode="movie_with_plot", text_blod=True, viewcontent='movies', + thumbnail=get_thumb('tvshows', auto=True), page=0), + + item.clone(title="Buscar", action="search", thumbnail=get_thumb('search', auto=True), + text_blod=True, url=host, page=0)] + + autoplay.show_option(item.channel, itemlist) + return itemlist + + +def menumovies(item): + logger.info() + itemlist = [item.clone(title="Novedades", action="peliculas", thumbnail=get_thumb('newest', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host + 'peliculas/', viewmode="movie_with_plot"), + + item.clone(title="Estrenos", action="peliculas", thumbnail=get_thumb('estrenos', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host + '?s=trfilter&trfilter=1&years%5B%5D=2018', viewmode="movie_with_plot"), + + item.clone(title="Más Vistas", action="peliculas", thumbnail=get_thumb('more watched', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host + 'peliculas-mas-vistas/', viewmode="movie_with_plot"), + + item.clone(title="Géneros", action="genresYears", thumbnail=get_thumb('genres', auto=True), + text_blod=True, page=0, viewcontent='movies', + url=host, viewmode="movie_with_plot"), + + item.clone(title="Estrenos por Año", action="genresYears", thumbnail=get_thumb('year', auto=True), + text_blod=True, page=0, viewcontent='movies', url=host, + viewmode="movie_with_plot"), + + item.clone(title="Buscar", action="search", thumbnail=get_thumb('search', auto=True), + text_blod=True, url=host, page=0, extra='buscarP')] + + return itemlist + + +def search(item, texto): + logger.info() + + texto = texto.replace(" ", "+") + item.url = urlparse.urljoin(item.url, "?s={0}".format(texto)) + + try: + return peliculas(item) + + # Se captura la excepción, para no interrumpir al buscador global si un canal falla + except: + import sys + for line in sys.exc_info(): + logger.error("{0}".format(line)) + return [] + + +def peliculas(item): + logger.info() + itemlist = [] + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|\(.*?\)|\s{2}| ", "", data) + data = scrapertools.decodeHtmlentities(data) + patron = '
.*?' # url + patron += '') + if next_page: + itemlist.append(item.clone(url=next_page, page=0, title="» Siguiente »", text_color=color3)) + + return itemlist + + +def genresYears(item): + logger.info() + itemlist = [] + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|\(.*?\)| |
", "", data) + data = scrapertools.decodeHtmlentities(data) + + if item.title == "Estrenos por Año": + patron_todas = 'ESTRENOS
(.*?) Géneros' + else: + patron_todas = 'Géneros(.*?)' + + data = scrapertools.find_single_match(data, patron_todas) + patron = '([^<]+)' # url, title + matches = scrapertools.find_multiple_matches(data, patron) + + for scrapedurl, scrapedtitle in matches: + + itemlist.append(item.clone(title=scrapedtitle, url=scrapedurl, action="peliculas")) + + return itemlist + + +def year_release(item): + logger.info() + itemlist = [] + + data = scrapertools.cache_page(item.url) + data = re.sub(r"\n|\r|\t|\s{2}| ", "", data) + patron = '
  • ([^<]+)
  • ' # url, title + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedtitle in matches: + + itemlist.append(item.clone(channel=item.channel, action="peliculas", title=scrapedtitle, page=0, + url=scrapedurl, text_color=color3, viewmode="movie_with_plot", extra='next')) + + return itemlist + + +def series(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|\(.*?\)| |
    ", "", data) + patron = '
    \s*.*?' # url + patron += '') + + if next_page: + itemlist.append(item.clone(url=next_page, page=0, + title="» Siguiente »", text_color=color3)) + + return itemlist + + +def temporadas(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t| |
    ", "", data) + patron = '
    0: + itemlist.append(Item(channel=__channel__, title="Añadir esta serie a la videoteca", url=item.url, + action="add_serie_to_library", extra="episodios", show=item.show, category="Series", + text_color=color1, thumbnail=thumbnail_host, fanart=fanart_host)) + + return itemlist + else: + return episodios(item) + + +def episodios(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t| |
    ", "", data) + patron = '
    0: + itemlist.append(Item(channel=__channel__, title="Añadir esta serie a la videoteca", url=item.url, + action="add_serie_to_library", extra="episodios", show=item.show, category="Series", + text_color=color1, thumbnail=thumbnail_host, fanart=fanart_host)) + + return itemlist + + +def findvideos(item): + logger.info() + itemlist = [] + + data = httptools.downloadpage(item.url).data + data = re.sub(r"\n|\r|\t|amp;|#038;|\(.*?\)|\s{2}| ", "", data) + data = scrapertools.decodeHtmlentities(data) + patron = 'data-tplayernv="Opt(.*?)">(.*?)(.*?)' # option, server, lang - quality + matches = re.compile(patron, re.DOTALL).findall(data) + + for option, servername, quote in matches: + patron = '(.*?) -([^<]+)