diff --git a/plugin.video.alfa/channels/animemovil.json b/plugin.video.alfa/channels/animemovil.json new file mode 100644 index 00000000..967cc348 --- /dev/null +++ b/plugin.video.alfa/channels/animemovil.json @@ -0,0 +1,50 @@ +{ + "id": "animemovil", + "name": "Animemovil", + "active": true, + "adult": false, + "language": ["*"], + "thumbnail": "", + "banner": "", + "version": 1, + "changes": [ + { + "date": "24/10/2017", + "description": "Primera version" + } + ], + "categories": [ + "anime" + ], + "settings": [ + { + "id": "modo_grafico", + "type": "bool", + "label": "Buscar información extra", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "perfil", + "type": "list", + "label": "Perfil de color", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "Perfil 3", + "Perfil 2", + "Perfil 1" + ] + } + ] +} diff --git a/plugin.video.alfa/channels/animemovil.py b/plugin.video.alfa/channels/animemovil.py new file mode 100644 index 00000000..ac9e621f --- /dev/null +++ b/plugin.video.alfa/channels/animemovil.py @@ -0,0 +1,406 @@ +# -*- coding: utf-8 -*- + +import re + +from channels import renumbertools +from core import httptools +from core import jsontools +from core import scrapertools +from core.item import Item +from platformcode import platformtools, config, logger + + +__modo_grafico__ = config.get_setting('modo_grafico', 'animemovil') +__perfil__ = int(config.get_setting('perfil', "animemovil")) + +# 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 = "" + +host = "http://animemovil.com" + + +def mainlist(item): + logger.info() + itemlist = [] + + itemlist.append(Item(channel=item.channel, action="recientes", title="Episodios Recientes", thumbnail=item.thumbnail, + url=host, text_color=color1, contentType="tvshow", extra="recientes")) + itemlist.append(Item(channel=item.channel, action="listado", title="Animes", thumbnail=item.thumbnail, + url="%s/_API/?src=animesRecientes&offset=0" % host, text_color=color1)) + itemlist.append(Item(channel=item.channel, action="emision", title="En emisión", thumbnail=item.thumbnail, + url="%s/anime/emision" % host, text_color=color2, contentType="tvshow")) + itemlist.append(Item(channel=item.channel, action="indices", title="Índices", thumbnail=item.thumbnail, + text_color=color2)) + + + itemlist.append(Item(channel=item.channel, action="search", title="Buscar...", + thumbnail=item.thumbnail, text_color=color3)) + + itemlist.append(item.clone(title="Configurar canal", action="openconfig", text_color=color5, folder=False)) + if renumbertools.context: + itemlist = renumbertools.show_option(item.channel, itemlist) + return itemlist + + +def openconfig(item): + ret = platformtools.show_channel_settings() + platformtools.itemlist_refresh() + return ret + + +def search(item, texto): + item.url = "%s/?s=%s" % (host, texto.replace(" ", "+")) + try: + return recientes(item) + except: + import sys + for line in sys.exc_info(): + logger.error("%s" % line) + return [] + + +def recientes(item): + logger.info() + item.contentType = "tvshow" + itemlist = [] + + data = httptools.downloadpage(item.url).data + bloque = scrapertools.find_single_match(data, '') + patron = '
  • \s*([^<]+)\s*') + show = re.sub(r"(?i) Ova| Especiales| \(Pelicula[s]*\)| \(Película[s]*\)| Sub| Español| Peliculas| Audio| Latino", "", show) + + if not item.infoLabels["plot"]: + item.infoLabels["plot"] = scrapertools.find_single_match(data, '
    .*?

    (.*?)

    ') + + bloque = scrapertools.find_single_match(data, 'ul class="lista"(.*?)') + matches = scrapertools.find_multiple_matches(bloque, '
  • .*?

    (.*?)

    ') + + bloque = scrapertools.find_single_match(data, 'ul class="lista"(.*?)') + matches = scrapertools.find_multiple_matches(bloque, '
  • .*?\s*(.*?)(.*?)') + patron = '
  • (.*?)') + patron = '
  • ' + matches = scrapertools.find_multiple_matches(data, patron) + for title, server in matches: + if title == "Vizard": + continue + title = "%s - %s" % (title, item.title) + post = "host=%s&id=%s" % (server, id) + itemlist.append(item.clone(action="play", url="http://server-2-stream.animemovil.com/V2/", title=title, + post=post)) + + downl = scrapertools.find_single_match(data, '
    .*?