From cbc2804651df714eb5be815e694484b4fbdac90a Mon Sep 17 00:00:00 2001 From: Unknown Date: Wed, 27 Jun 2018 16:38:27 -0300 Subject: [PATCH] playview + servidores nuevos + fixes --- plugin.video.alfa/channels/playview.json | 65 +++++ plugin.video.alfa/channels/playview.py | 317 ++++++++++++++++++++++ plugin.video.alfa/servers/clipwatching.py | 5 +- plugin.video.alfa/servers/cloudvideo.json | 42 +++ plugin.video.alfa/servers/cloudvideo.py | 43 +++ plugin.video.alfa/servers/filevideo.json | 42 +++ plugin.video.alfa/servers/filevideo.py | 42 +++ plugin.video.alfa/servers/upvid.json | 42 +++ plugin.video.alfa/servers/upvid.py | 83 ++++++ plugin.video.alfa/servers/vidzella.json | 42 +++ plugin.video.alfa/servers/vidzella.py | 33 +++ plugin.video.alfa/servers/vivo.json | 42 +++ plugin.video.alfa/servers/vivo.py | 39 +++ plugin.video.alfa/servers/watchvideo.json | 4 + plugin.video.alfa/servers/watchvideo.py | 7 +- 15 files changed, 845 insertions(+), 3 deletions(-) create mode 100644 plugin.video.alfa/channels/playview.json create mode 100644 plugin.video.alfa/channels/playview.py create mode 100644 plugin.video.alfa/servers/cloudvideo.json create mode 100644 plugin.video.alfa/servers/cloudvideo.py create mode 100644 plugin.video.alfa/servers/filevideo.json create mode 100644 plugin.video.alfa/servers/filevideo.py create mode 100644 plugin.video.alfa/servers/upvid.json create mode 100644 plugin.video.alfa/servers/upvid.py create mode 100644 plugin.video.alfa/servers/vidzella.json create mode 100644 plugin.video.alfa/servers/vidzella.py create mode 100644 plugin.video.alfa/servers/vivo.json create mode 100644 plugin.video.alfa/servers/vivo.py diff --git a/plugin.video.alfa/channels/playview.json b/plugin.video.alfa/channels/playview.json new file mode 100644 index 00000000..1d9a70e0 --- /dev/null +++ b/plugin.video.alfa/channels/playview.json @@ -0,0 +1,65 @@ +{ + "id": "playview", + "name": "Playview", + "active": true, + "adult": false, + "language": [ + "lat", "cast" + ], + "thumbnail": "https://s15.postimg.cc/pkcz7kda3/playview.png", + "banner": "", + "version": 1, + "categories": [ + "movie", + "tvshow", + "anime" + ], + "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" + ] + }, + { + "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 + } + ] +} diff --git a/plugin.video.alfa/channels/playview.py b/plugin.video.alfa/channels/playview.py new file mode 100644 index 00000000..ed093f00 --- /dev/null +++ b/plugin.video.alfa/channels/playview.py @@ -0,0 +1,317 @@ +# -*- coding: utf-8 -*- +# -*- Channel Playview -*- +# -*- Created for Alfa-addon -*- +# -*- By the Alfa Develop Group -*- + +import re +import urllib +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 + + +IDIOMAS = {'Latino':'Lat', 'Español':'Cast', 'Subtitulado':'VOSE'} +list_language = IDIOMAS.values() +list_quality = ['HD 1080p', 'HD 720p', 'DVDRIP', 'CAM'] +list_servers = ['openload', 'vidoza', 'clipwatching', 'fastplay', 'flashx', 'gamovideo', 'powvideo', 'streamango', + 'streamcherry', 'rapidvideo'] + +host = 'https://playview.io/' + + +def mainlist(item): + logger.info() + + autoplay.init(item.channel, list_servers, list_quality) + + itemlist = [] + + itemlist.append(Item(channel=item.channel, title='Películas', action='submenu', type='movie', + thumbnail=get_thumb('movies', auto=True))) + itemlist.append(Item(channel=item.channel, title='Series', action='submenu', type='tvshow', + thumbnail=get_thumb('tvshows', auto=True))) + itemlist.append(Item(channel=item.channel, title='Anime', action='list_all', url=host+'anime-online', + type='tvshow', first=0, thumbnail=get_thumb('anime', auto=True))) + itemlist.append(Item(channel=item.channel, title='Buscar', action='search', url=host+'search/', + thumbnail=get_thumb('search', auto=True))) + + autoplay.show_option(item.channel, itemlist) + + return itemlist + + +def submenu(item): + logger.info() + + itemlist = [] + if item.type == 'movie': + itemlist.append( + Item(channel=item.channel, title='Todas', action='list_all', url=host + 'peliculas-online', type='movie', + first=0, thumbnail=get_thumb('all', auto=True))) + itemlist.append( + Item(channel=item.channel, title='Generos', action='genres', thumbnail=get_thumb('genres', auto=True))) + else: + itemlist.append( + Item(channel=item.channel, title='Todas', action='list_all', url=host + 'series-online', type='tvshow', + first=0, thumbnail=get_thumb('all', auto=True))) + itemlist.append( + Item(channel=item.channel, title='Series Animadas', action='list_all', url=host + 'series-animadas-online', + type='tvshow', first=0, thumbnail=get_thumb('animacion', auto=True))) + + 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 genres(item): + logger.info() + + itemlist = [] + + data = get_source(host) + patron = '
  • (.*?)
  • ' + matches = re.compile(patron, re.DOTALL).findall(data) + + for value, url, title in matches: + if value not in ['1', '4', '22', '23', '24']: + if value == '20': + title = 'Familiar' + itemlist.append(Item(channel=item.channel, title=title, action='list_all', url=url, type='Movie', first=0)) + + + return sorted(itemlist, key=lambda i: i.title) + +def list_all(item): + logger.info() + + itemlist = [] + next = False + + data = get_source(item.url) + patron = 'spotlight_container>.*?image lazy data-original=(.*?)>.*?
    (.*?)<' + patron += '(.*?) sres>(\d{4})<.*?playLink href=(.*?)>' + + matches = re.compile(patron, re.DOTALL).findall(data) + + first = item.first + last = first+19 + if last > len(matches): + last = len(matches) + next = True + + for scrapedthumbnail, scrapedtitle, type_data, year, scrapedurl in matches[first:last]: + + url = scrapedurl + title = scrapedtitle + season = scrapertools.find_single_match(type_data, 'class=title-season>Temporada<.*?> (\d+) <') + episode = scrapertools.find_single_match(type_data, 'class=title-season>Episodio<.*?> (\d+) <') + if season != '' or episode != '': + item.type = 'tvshow' + else: + item.type = 'movie' + + new_item = Item(channel=item.channel, title=title, url=url, thumbnail=scrapedthumbnail, type=item.type, + infoLabels={'year': year}) + + if item.type == 'tvshow': + new_item.action = 'episodios' + new_item.contentSerieName = scrapedtitle + season = season.strip() + episode = episode.strip() + if season == '': + if 'Anime' in item.title: + season = 1 + else: + season = scrapertools.find_single_match(url, '.*?temp-(\d+)') + new_item.contentSeasonNumber = season + else: + new_item.contentSeasonNumber = season + + if episode != '': + new_item.contentEpisodeNumber = episode + + if season != '' and episode != '': + new_item.title = '%s %sx%s' % (new_item.title, season, episode) + elif episode == '': + new_item.title = '%s Temporada %s' % (new_item.title, season) + else: + new_item.action = 'findvideos' + new_item.contentTitle = scrapedtitle + itemlist.append(new_item) + + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + # Paginación + + if not next: + url_next_page = item.url + first = last + else: + url_next_page = scrapertools.find_single_match(data, "") + first = 0 + + if url_next_page: + itemlist.append(item.clone(title="Siguiente >>", url=url_next_page, action='list_all', first=first)) + return itemlist + + +def get_data(post): + logger.info() + + post = urllib.urlencode(post) + data = httptools.downloadpage(host + 'playview', post=post).data + + return data + +def episodios(item): + logger.info() + + itemlist = [] + data = get_source(item.url) + try: + id, type = scrapertools.find_single_match(data, 'data-id=(\d+) data-type=(.*?) ') + post = {'set': 'LoadOptionsEpisode', 'action': 'EpisodeList', 'id': id, 'type': '1'} + data = get_data(post) + patron = 'data-episode="(\d+)".*?title="(.*?)"' + matches = re.compile(patron, re.DOTALL).findall(data) + infoLabels = item.infoLabels + for episode, title in matches: + post = {'set': 'LoadOptionsEpisode', 'action': 'Step1', 'id': id, 'type': '1', + 'episode': episode} + season = scrapertools.find_single_match(item.url, '.*?temp-(\d+)') + if season == '': + season = 1 + infoLabels['season'] = season + infoLabels['episode'] = episode + if title[0].isdigit(): + title = '%sx%s' % (season, title) + else: + title = '%sx%s - %s' % (season, episode, title) + itemlist.append(Item(channel=item.channel, title=title, contentSeasonNumber=season, + contentEpisodeNumber=episode, action='findvideos', post=post, type=item.type, + 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="episodios", contentSerieName=item.contentSerieName, )) + except: + pass + + return itemlist + + + +def findvideos(item): + logger.info() + itemlist = [] + set_mode = 'LoadOptions' + episode = '' + if item.type == 'tvshow': + post = item.post + id= post['id'] + episode = post['episode'] + type = post['type'] + set_mode = 'LoadOptionsEpisode' + + else: + data=get_source(item.url) + try: + id, type = scrapertools.find_single_match(data, 'data-id=(\d+) data-type=(.*?) ') + post = {'set': set_mode, 'action': 'Step1', 'id': id, 'type': type} + except: + pass + + try: + data = get_data(post) + patron = 'data-quality="(.*?)"' + matches = re.compile(patron, re.DOTALL).findall(data) + + for quality in matches: + post = {'set': set_mode, 'action': 'Step2', 'id': id, 'type': type, 'quality': quality, 'episode':episode} + data = get_data(post) + patron = 'getplayer" data-id="(\d+)">

    (.*?)

    .*?title="(.*?)"' + matches = re.compile(patron, re.DOTALL).findall(data) + + for video_id, language, server in matches: + post = {'set': set_mode, 'action': 'Step3', 'id': video_id, 'type': type} + data = get_data(post) + url = scrapertools.find_single_match(data, '