From 846ca4d84b763db19e10c1777dc85240ec0ebe19 Mon Sep 17 00:00:00 2001 From: Intel1 <25161862+Intel11@users.noreply.github.com> Date: Tue, 29 May 2018 14:55:51 -0500 Subject: [PATCH] seriesverde: nuevo canal --- plugin.video.alfa/channels/seriesverde.json | 37 +++ plugin.video.alfa/channels/seriesverde.py | 311 ++++++++++++++++++++ 2 files changed, 348 insertions(+) create mode 100644 plugin.video.alfa/channels/seriesverde.json create mode 100644 plugin.video.alfa/channels/seriesverde.py diff --git a/plugin.video.alfa/channels/seriesverde.json b/plugin.video.alfa/channels/seriesverde.json new file mode 100644 index 00000000..8a9a8aeb --- /dev/null +++ b/plugin.video.alfa/channels/seriesverde.json @@ -0,0 +1,37 @@ +{ + "id": "seriesverde", + "name": "SeriesVerde", + "active": true, + "adult": false, + "language": ["cast", "lat"], + "thumbnail": "https://s33.postimg.cc/96dhv4trj/seriesverde.png", + "banner": "", + "categories": [ + "tvshow" + ], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "default": false, + "enabled": false, + "visible": false + }, + { + "id": "filter_languages", + "type": "list", + "label": "Mostrar enlaces en idioma...", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "No filtrar", + "Cast", + "Lat", + "VOSE", + "VO" + ] + } + ] +} diff --git a/plugin.video.alfa/channels/seriesverde.py b/plugin.video.alfa/channels/seriesverde.py new file mode 100644 index 00000000..4061bcf9 --- /dev/null +++ b/plugin.video.alfa/channels/seriesverde.py @@ -0,0 +1,311 @@ +# -*- coding: utf-8 -*- +# -*- Channel SeriesVerde -*- +# -*- Created for Alfa-addon -*- +# -*- By the Alfa Develop Group -*- + +import re + +from channels import autoplay +from channels import filtertools +from core import httptools +from core import scrapertools +from core import servertools +from core import tmdb +from core.item import Item +from platformcode import config, logger +from channelselector import get_thumb + +host = 'http://seriesverde.com/' + +IDIOMAS = {'es': 'Cast', 'la': 'Lat', 'vos': 'VOSE', 'vo': 'VO'} +list_language = IDIOMAS.values() +list_quality = ['SD', 'Micro-HD-720p', '720p', 'HDitunes', 'Micro-HD-1080p' ] +list_servers = ['powvideo','yourupload', 'openload', 'gamovideo', 'flashx', 'clipwatching', 'streamango', 'streamcloud'] + + +def mainlist(item): + logger.info() + + autoplay.init(item.channel, list_servers, list_quality) + + itemlist = [] + + itemlist.append(Item(channel=item.channel, + title="Todas", + action="list_all", + thumbnail=get_thumb('all', auto=True), + url=host + 'listado/', + )) + + itemlist.append(Item(channel=item.channel, + title="Generos", + action="section", + thumbnail=get_thumb('genres', auto=True), + url=host, + )) + + itemlist.append(Item(channel=item.channel, + title="A - Z", + action="section", + thumbnail=get_thumb('alphabet', auto=True), + url=host+'listado/', )) + + itemlist.append(Item(channel=item.channel, + title="Buscar", + action="search", + thumbnail=get_thumb('search', auto=True))) + + itemlist = filtertools.show_option(itemlist, item.channel, list_language, list_quality) + autoplay.show_option(item.channel, itemlist) + + 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 list_all(item): + logger.info() + + itemlist = [] + data = get_source(item.url) + contentSerieName = '' + + patron = "
.*?src='(.*?)' title='(.*?)'" + matches = re.compile(patron, re.DOTALL).findall(data) + + + for scrapedurl, scrapedthumbnail, scrapedtitle in matches: + + url = host + scrapedurl + thumbnail = scrapedthumbnail + title = scrapedtitle + + itemlist.append(Item(channel=item.channel, + action='seasons', + title=title, + url=url, + thumbnail=thumbnail, + contentTitle=scrapedtitle, + contentSerieName=contentSerieName, + context=filtertools.context(item, list_language, list_quality), + )) + + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + + # #Paginacion + + if itemlist != []: + base_page = scrapertools.find_single_match(item.url,'(.*?)?') + next_page = scrapertools.find_single_match(data, '>>') + if next_page != '': + itemlist.append(Item(channel=item.channel, + action="lista", + title='Siguiente >>>', + url=base_page+next_page, + thumbnail='https://s16.postimg.cc/9okdu7hhx/siguiente.png', + )) + return itemlist + + +def section(item): + logger.info() + + itemlist = [] + data = get_source(item.url) + if item.title == 'Generos': + patron = '
  • (.*?)
  • ' + elif item.title == 'A - Z': + patron = "(.*?)" + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedtitle in matches: + + url = host + scrapedurl + title = scrapedtitle + itemlist.append(Item(channel=item.channel, + action='list_all', + title=title, + url=url + )) + return itemlist + +def seasons(item): + logger.info() + itemlist = [] + data = get_source(item.url) + + patron = '.*?Temporada (\d+) ' + matches = re.compile(patron, re.DOTALL).findall(data) + infoLabels=item.infoLabels + for scrapedseason in matches: + url = item.url + title = 'Temporada %s' % scrapedseason + contentSeasonNumber = scrapedseason + infoLabels['season'] = contentSeasonNumber + thumbnail = item.thumbnail + itemlist.append(Item(channel=item.channel, + action="episodesxseason", + title=title, + url=url, + thumbnail=thumbnail, + contentSeasonNumber=contentSeasonNumber, + infoLabels=infoLabels + )) + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + if config.get_videolibrary_support() and len(itemlist) > 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="all_episodes", + contentSerieName=item.contentSerieName, + )) + + return itemlist + + +def all_episodes(item): + logger.info() + itemlist = [] + templist = seasons(item) + for tempitem in templist: + itemlist += episodesxseason(tempitem) + return itemlist + + +def episodesxseason(item): + logger.info() + itemlist = [] + data = get_source(item.url) + season = item.contentSeasonNumber + patron = "%s+x(\d+) - (.*?) .*?(/banderas.*?)" % \ + season + matches = re.compile(patron, re.DOTALL).findall(data) + infoLabels = item.infoLabels + for scrapedurl, scraped_episode, scrapedtitle, lang_data in matches: + url = host + scrapedurl + title = '%sx%s - %s' % (season, scraped_episode, scrapedtitle.strip()) + infoLabels['episode'] = scraped_episode + thumbnail = item.thumbnail + title, language = add_language(title, lang_data) + itemlist.append(Item(channel=item.channel, + action="findvideos", + title=title, + url=url, + thumbnail=thumbnail, + language=language, + infoLabels=infoLabels + )) + + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + return itemlist + + +def add_language(title, string): + logger.info() + language = [] + languages = scrapertools.find_multiple_matches(string, '/banderas/(.*?).png') + + for lang in languages: + if lang == 'japvose': + lang = 'vos' + language.append(IDIOMAS[lang]) + title = '%s [%s]' % (title, IDIOMAS[lang]) + + return title, language + + +def findvideos(item): + logger.info() + + itemlist = [] + + data = get_source(item.url) + patron = "|\s{2,}', "", data) + patron = ".*?src=(.*?) style.*?value=(.*?)>" + + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedthumb, scrapedtitle in matches: + itemlist.append(Item(channel=item.channel, + title=scrapedtitle, + url=host+scrapedurl, + action="seasons", + thumbnail=scrapedthumb, + contentSerieName=scrapedtitle, + context=filtertools.context(item, list_language, list_quality) + )) + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + + return itemlist + + +def search(item, texto): + logger.info() + import urllib + if texto != '': + post = {'query':texto} + post = urllib.urlencode(post) + item.post = post + + return search_results(item)