(.*?)
.*?' + patron += "(.*?)
(\d{4}) /.*?.*?'(\d+)'" + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedthumbnail, scrapedurl, scrapedtitle, scrapedplot, year, video_id in matches: + + title = '%s [%s]' % (scrapedtitle, year) + contentTitle = scrapedtitle + thumbnail = scrapedthumbnail + url = scrapedurl + + itemlist.append(item.clone(action='findvideos', + title=title, + url=url, + thumbnail=thumbnail, + contentTitle=contentTitle, + video_id=video_id, + infoLabels={'year':year})) + + elif item.type == 'series': + patron = '(.*?)
(.*?)
(\d{4}) /' + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedthumbnail, scrapedtitle, scrapedplot, year in matches: + title = scrapedtitle + contentSerieName = scrapedtitle + thumbnail = scrapedthumbnail + url = scrapedurl + + itemlist.append(item.clone(action='seasons', + title=title, + url=url, + thumbnail=thumbnail, + plot=scrapedplot, + contentSerieName=contentSerieName, + infoLabels={'year':year})) + + tmdb.set_infoLabels(itemlist, seekTmdb=True) + # Paginación + + 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')) + + return itemlist + +def seasons(item): + logger.info() + + itemlist=[] + + data=get_source(item.url) + patron='|\s{2,}', "", data) + packed = scrapertools.find_single_match(data, '(eval\(.*?);var') + unpacked = jsunpack.unpack(packed) + logger.debug('unpacked %s' % unpacked) + server = scrapertools.find_single_match(unpacked, "src:.'(http://\D+)/") + id = scrapertools.find_single_match(unpacked, "src:.'http://\D+/.*?description:.'(.*?).'") + if server == '': + if 'powvideo' in unpacked: + id = scrapertools.find_single_match(unpacked ,",description:.'(.*?).'") + server= 'https://powvideo.net' + url = '%s/%s' % (server, id) + if server != '' and id != '': + language = IDIOMAS[video_info['idioma']] + quality = CALIDADES[video_info['calidad']] + title = ' [%s] [%s]' % (language, quality) + itemlist.append(Item(channel=item.channel, title='%s'+title, url=url, action='play', language=language, + quality=quality)) + + itmelist = servertools.get_servers_itemlist(itemlist, lambda i: i.title % i.server.capitalize()) + return sorted(itemlist, key=lambda i: i.language) + + +def search(item, texto): + logger.info() + texto = texto.replace(" ", "+") + item.url = item.url + texto + item.type = 'peliculas' + if texto != '': + return search_results(item) + else: + return [] + +def search_results(item): + logger.info() + + itemlist=[] + + data=get_source(item.url) + logger.debug(data) + patron = '
(.*?)
(.*?)
(\d{4})<' + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, content_type ,scrapedthumb, scrapedtitle, scrapedplot, year in matches: + + title = scrapedtitle + url = scrapedurl + thumbnail = scrapedthumb + plot = scrapedplot + if content_type != 'Serie': + action = 'findvideos' + else: + action = 'seasons' + + new_item=Item(channel=item.channel, title=title, url=url, thumbnail=thumbnail, plot=plot, + action=action, type=content_type, infoLabels={'year':year}) + if new_item.action == 'findvideos': + new_item.contentTitle = new_item.title + else: + new_item.contentSerieName = new_item.title + + itemlist.append(new_item) + + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + + return itemlist + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria in ['peliculas']: + item.url = host + 'peliculas' + elif categoria == 'infantiles': + item.url = host + 'peliculas/generos/animación' + elif categoria == 'terror': + item.url = host + 'peliculas/generos/terror' + item.type='peliculas' + 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/pelisr.json b/plugin.video.alfa/channels/pelisr.json new file mode 100644 index 00000000..92257e9e --- /dev/null +++ b/plugin.video.alfa/channels/pelisr.json @@ -0,0 +1,79 @@ +{ +"id": "pelisr", + "name": "PelisR", + "active": true, + "adult": false, + "language": ["lat", "cast", "vose"], + "thumbnail": "https://s22.postimg.cc/gcp2jqbs1/pelisr.png", + "banner": "", + "categories": [ + "movie", + "tvshow", + "direct" + ], + "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/pelisr.py b/plugin.video.alfa/channels/pelisr.py new file mode 100644 index 00000000..7d826449 --- /dev/null +++ b/plugin.video.alfa/channels/pelisr.py @@ -0,0 +1,366 @@ +# -*- coding: utf-8 -*- +# -*- Channel PoseidonHD -*- +# -*- 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 = {'mx': 'Latino', 'dk':'Latino', 'es': 'Castellano', 'en': 'VOSE', 'gb':'VOSE'} +list_language = IDIOMAS.values() + +list_quality = ['360P', '480P', '720P', '1080P'] + +list_servers = [ + 'directo', + 'openload', + 'rapidvideo' +] + +__comprueba_enlaces__ = config.get_setting('comprueba_enlaces', 'poseidonhd') +__comprueba_enlaces_num__ = config.get_setting('comprueba_enlaces_num', 'poseidonhd') + +host = 'https://pelisr.com/' + +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))) + itemlist.append(Item(channel=item.channel, title='Series', url=host+'tvshows', action='list_all', type='tvshows', + thumbnail= get_thumb('tvshows', auto=True))) + itemlist.append( + item.clone(title="Buscar", action="search", url=host + '?s=', 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='Todas', url=host + 'movies', action='list_all', + thumbnail=get_thumb('all', auto=True), type='movies')) + 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 = [] + logger.debug(lang_data) + 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=[] + duplicados=[] + data = get_source(host+'/'+item.type) + if 'Genero' in item.title: + patron = '
(.*?)
' + matches = re.compile(patron, re.DOTALL).findall(data) + + for scrapedurl, scrapedthumb, scrapedtitle, year, lang_data, scrapedplot in matches: + + title = scrapedtitle + url = scrapedurl + thumbnail = scrapedthumb + plot = scrapedplot + language = get_language(lang_data) + if language: + action = 'findvideos' + else: + action = 'seasons' + + new_item=Item(channel=item.channel, title=title, url=url, thumbnail=thumbnail, plot=plot, + action=action, + language=language, infoLabels={'year':year}) + if new_item.action == 'findvideos': + new_item.contentTitle = new_item.title + else: + new_item.contentSerieName = new_item.title + + itemlist.append(new_item) + + tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True) + + return itemlist + +def newest(categoria): + logger.info() + itemlist = [] + item = Item() + try: + if categoria in ['peliculas']: + item.url = host + 'movies/' + elif categoria == 'infantiles': + item.url = host + 'genre/animacion/' + elif categoria == 'terror': + item.url = host + 'genre/terror/' + item.type='movies' + 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/retroseriestv.json b/plugin.video.alfa/channels/retroseriestv.json new file mode 100644 index 00000000..cde2358b --- /dev/null +++ b/plugin.video.alfa/channels/retroseriestv.json @@ -0,0 +1,22 @@ +{ + "id": "retroseriestv", + "name": "RetroSeriesTV", + "active": true, + "adult": false, + "language": ["lat", "cast"], + "thumbnail": "https://retroseriestv.com/wp-content/uploads/2017/04/Logo3-5.png", + "banner": "", + "categories": [ + "tvshow" + ], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Incluir en busqueda global", + "default": false, + "enabled": false, + "visible": false + } + ] +} \ No newline at end of file diff --git a/plugin.video.alfa/channels/retroseriestv.py b/plugin.video.alfa/channels/retroseriestv.py new file mode 100644 index 00000000..2386b82f --- /dev/null +++ b/plugin.video.alfa/channels/retroseriestv.py @@ -0,0 +1,213 @@ +# -*- coding: utf-8 -*- +# -*- Channel RetroSeriesTV -*- +# -*- Created for Alfa-addon -*- +# -*- By the Alfa Develop Group -*- + +import re +import urllib +from channelselector import get_thumb +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 channels import autoplay +from channels import filtertools + + +host = 'https://retroseriestv.com/' + +# IDIOMAS = {'la': 'LAT', 'es': 'Cast'} +# list_language = IDIOMAS.values() +# list_quality = [] +# list_servers = ['openload'] + + +def mainlist(item): + logger.info() + + itemlist = list() + itemlist.append(item.clone(title="Todas", action="list_all", url=host + 'seriestv/', thumbnail=get_thumb('all', + auto=True))) + + itemlist.append(item.clone(title="Generos", action="section", url=host, thumbnail=get_thumb('genres', auto=True), + section='genres')) + + itemlist.append(item.clone(title="Por Año", action="section", url=host, thumbnail=get_thumb('year', auto=True), + section='year')) + + itemlist.append(item.clone(title="Alfabetico", action="section", url=host, thumbnail=get_thumb('alphabet', auto=True), + section='abc')) + + itemlist.append(item.clone(title="Buscar", action="search", url=host+'?s=', + thumbnail=get_thumb('search', 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 list_all(item): + logger.info() + itemlist = [] + + data = get_source(item.url) + patron = '
- ' % item.section)
+ patron = '(.*?)'
+ matches = re.compile(patron, re.DOTALL).findall(data)
+
+ for scrapedurl, scrapedtitle in matches:
+ url = scrapedurl.strip()
+ itemlist.append(Item(channel=item.channel, title=scrapedtitle, url=url, action='list_all'))
+
+ return itemlist
+
+def seasons(item):
+ logger.info()
+
+ itemlist = []
+ data = get_source(item.url)
+ patron = 'Temporada(\d+) <'
+ matches = re.compile(patron, re.DOTALL).findall(data)
+
+ for scrapedtitle in matches:
+ infoLabels = item.infoLabels
+ infoLabels['season'] = scrapedtitle
+ title = 'Temporada %s' % scrapedtitle
+ itemlist.append(Item(channel=item.channel, title=title, url=item.url, action='episodesxseason',
+ 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,
+ extra1='library'))
+
+ return itemlist
+
+def episodios(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)
+ infoLabels = item.infoLabels
+ season = infoLabels['season']
+ patron = '
|\s{2,}', "", data)
+ return data
-def home_section(item):
- logger.info("section = %s" % item.extra)
+def list_all(item):
+ logger.info()
- pattern = "['\"]panel-title['\"]>[^/]*%s(.*?)(?:panel-title|\Z)" % item.extra
- # logger.debug("pattern = %s" % pattern)
-
- data = httptools.downloadpage(item.url).data
- result = re.search(pattern, data, re.MULTILINE | re.DOTALL)
-
- if result:
- # logger.debug("found section: {0}".format(result.group(1)))
- item.extra = 1
- return extract_series_from_data(item, result.group(1))
-
- logger.debug("No match")
- return []
-
-
-def extract_series_from_data(item, data):
itemlist = []
- episode_pattern = re.compile('/capitulo-([0-9]+)/')
- shows = re.findall("|\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) diff --git a/plugin.video.alfa/channels/veseriesonline.py b/plugin.video.alfa/channels/veseriesonline.py index b1ba3b7b..0b9aeef0 100644 --- a/plugin.video.alfa/channels/veseriesonline.py +++ b/plugin.video.alfa/channels/veseriesonline.py @@ -183,50 +183,56 @@ def findvideos(item): # listado de opciones links_url - data = get_source(links_url) - patron = 'content >