From d7ab91f2f95dd8e3f7e5d06b3a7175a4583fdd50 Mon Sep 17 00:00:00 2001 From: Intel1 Date: Mon, 28 Aug 2017 15:19:03 -0500 Subject: [PATCH 1/6] Update platformtools.py --- plugin.video.alfa/platformcode/platformtools.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugin.video.alfa/platformcode/platformtools.py b/plugin.video.alfa/platformcode/platformtools.py index 61e6f7b7..f2d001a8 100644 --- a/plugin.video.alfa/platformcode/platformtools.py +++ b/plugin.video.alfa/platformcode/platformtools.py @@ -452,7 +452,7 @@ def is_playing(): return xbmc.Player().isPlaying() -def play_video(item, strm=False): +def play_video(item, strm=False, force_direct=False): logger.info() # logger.debug(item.tostring('\n')) @@ -503,7 +503,17 @@ def play_video(item, strm=False): xlistitem.setProperty('inputstream.adaptive.manifest_type', 'mpd') # se lanza el reproductor - set_player(item, xlistitem, mediaurl, view, strm) + if force_direct: # cuando viene de una ventana y no directamente de la base del addon + # Añadimos el listitem a una lista de reproducción (playlist) + playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO) + playlist.clear() + playlist.add(mediaurl, xlistitem) + + # Reproduce + xbmc_player = xbmc.Player() + xbmc_player.play(playlist, xlistitem) + else: + set_player(item, xlistitem, mediaurl, view, strm) def stop_video(): From 7315fffcb818b0c10f97d9d0b826a3e4c297ac70 Mon Sep 17 00:00:00 2001 From: Intel1 Date: Mon, 28 Aug 2017 15:31:31 -0500 Subject: [PATCH 2/6] Update news.py --- plugin.video.alfa/channels/news.py | 70 +++++++++++++----------------- 1 file changed, 29 insertions(+), 41 deletions(-) diff --git a/plugin.video.alfa/channels/news.py b/plugin.video.alfa/channels/news.py index 5096e6a8..5f3a29e0 100755 --- a/plugin.video.alfa/channels/news.py +++ b/plugin.video.alfa/channels/news.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- # ------------------------------------------------------------ # Channel for recent videos on several channels # ------------------------------------------------------------ @@ -41,63 +41,51 @@ def mainlist(item): if list_canales['peliculas']: thumbnail = get_thumb("channels_movie.png") - new_item = Item(channel=item.channel, action="novedades", extra="peliculas", title="Películas", - thumbnail=thumbnail) + new_item = Item(channel=item.channel, action="novedades", extra="peliculas", title="Películas", + thumbnail=thumbnail) - new_item.context = [{"title": "Canales incluidos en: %s" % new_item.title, - "extra": new_item.extra, - "action": "setting_channel", - "channel": new_item.channel}] - new_item.category = "Novedades en %s" % new_item.extra - itemlist.append(new_item) + set_category_context(new_item) + itemlist.append(new_item) if list_canales['infantiles']: thumbnail = get_thumb("channels_children.png") - new_item = Item(channel=item.channel, action="novedades", extra="infantiles", title="Para niños", - thumbnail=thumbnail) - new_item.context = [{"title": "Canales incluidos en: %s" % new_item.title, - "extra": new_item.extra, - "action": "setting_channel", - "channel": new_item.channel}] - new_item.category = "Novedades en %s" % new_item.extra - itemlist.append(new_item) + new_item = Item(channel=item.channel, action="novedades", extra="infantiles", title="Para niños", + thumbnail=thumbnail) + set_category_context(new_item) + itemlist.append(new_item) if list_canales['series']: thumbnail = get_thumb("channels_tvshow.png") - new_item = Item(channel=item.channel, action="novedades", extra="series", title="Episodios de series", - thumbnail=thumbnail) - new_item.context = [{"title": "Canales incluidos en: %s" % new_item.title, - "extra": new_item.extra, - "action": "setting_channel", - "channel": new_item.channel}] - new_item.category = "Novedades en %s" % new_item.extra - itemlist.append(new_item) + new_item = Item(channel=item.channel, action="novedades", extra="series", title="Episodios de series", + thumbnail=thumbnail) + set_category_context(new_item) + itemlist.append(new_item) if list_canales['anime']: thumbnail = get_thumb("channels_anime.png") - new_item = Item(channel=item.channel, action="novedades", extra="anime", title="Episodios de anime", - thumbnail=thumbnail) - new_item.context = [{"title": "Canales incluidos en: %s" % new_item.title, - "extra": new_item.extra, - "action": "setting_channel", - "channel": new_item.channel}] - new_item.category = "Novedades en %s" % new_item.extra - itemlist.append(new_item) + new_item = Item(channel=item.channel, action="novedades", extra="anime", title="Episodios de anime", + thumbnail=thumbnail) + set_category_context(new_item) + itemlist.append(new_item) if list_canales['documentales']: thumbnail = get_thumb("channels_documentary.png") - new_item = Item(channel=item.channel, action="novedades", extra="documentales", title="Documentales", - thumbnail=thumbnail) - new_item.context = [{"title": "Canales incluidos en: %s" % new_item.title, - "extra": new_item.extra, - "action": "setting_channel", - "channel": new_item.channel}] - new_item.category = "Novedades en %s" % new_item.extra - itemlist.append(new_item) + new_item = Item(channel=item.channel, action="novedades", extra="documentales", title="Documentales", + thumbnail=thumbnail) + set_category_context(new_item) + itemlist.append(new_item) return itemlist +def set_category_context(item): + item.context = [{"title": "Canales incluidos en: %s" % item.title, + "extra": item.extra, + "action": "setting_channel", + "channel": item.channel}] + item.category = "Novedades en %s" % item.extra + + def get_channels_list(): logger.info() From 9ae45b0762e3422562f4831751b0aa616edf500c Mon Sep 17 00:00:00 2001 From: Intel1 Date: Mon, 28 Aug 2017 15:33:33 -0500 Subject: [PATCH 3/6] Update trailertools.py --- plugin.video.alfa/channels/trailertools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.video.alfa/channels/trailertools.py b/plugin.video.alfa/channels/trailertools.py index d92c3b9d..9f592c78 100755 --- a/plugin.video.alfa/channels/trailertools.py +++ b/plugin.video.alfa/channels/trailertools.py @@ -542,7 +542,7 @@ try: elif item.action == "play" and not self.item.windowed: for window in window_select: window.close() - retorna = platformtools.play_video(item) + retorna = platformtools.play_video(item, force_direct=True) if not retorna: while True: xbmc.sleep(1000) From 84494748de22915aab70506f087ccdefbd622e0c Mon Sep 17 00:00:00 2001 From: Intel1 Date: Mon, 28 Aug 2017 16:14:51 -0500 Subject: [PATCH 4/6] Update gvideo.json --- plugin.video.alfa/servers/gvideo.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugin.video.alfa/servers/gvideo.json b/plugin.video.alfa/servers/gvideo.json index 4e487d03..92e6c799 100644 --- a/plugin.video.alfa/servers/gvideo.json +++ b/plugin.video.alfa/servers/gvideo.json @@ -48,5 +48,6 @@ "visible": false } ], + "thumbnail": "https://s11.postimg.org/giobzkprz/logo-google1.png", "version": 1 -} \ No newline at end of file +} From ca0ec5770fe654fd919ea3190a21236741ea776c Mon Sep 17 00:00:00 2001 From: Intel1 Date: Mon, 28 Aug 2017 16:21:34 -0500 Subject: [PATCH 5/6] Update peliculasrey.py --- plugin.video.alfa/channels/peliculasrey.py | 92 ++++++++++------------ 1 file changed, 42 insertions(+), 50 deletions(-) diff --git a/plugin.video.alfa/channels/peliculasrey.py b/plugin.video.alfa/channels/peliculasrey.py index 047fb824..66dbf1e3 100755 --- a/plugin.video.alfa/channels/peliculasrey.py +++ b/plugin.video.alfa/channels/peliculasrey.py @@ -9,18 +9,18 @@ from core import servertools from core.item import Item from platformcode import logger, config +host = "http://www.peliculasrey.com/" def mainlist(item): logger.info() itemlist = [] - itemlist.append( - Item(channel=item.channel, action="PorFecha", title="Año de Lanzamiento", url="http://www.peliculasrey.com")) - itemlist.append(Item(channel=item.channel, action="Idiomas", title="Idiomas", url="http://www.peliculasrey.com")) - itemlist.append( - Item(channel=item.channel, action="calidades", title="Por calidad", url="http://www.peliculasrey.com")) - itemlist.append(Item(channel=item.channel, action="generos", title="Por género", url="http://www.peliculasrey.com")) - itemlist.append(Item(channel=item.channel, action="search", title="Buscar...", url="http://www.peliculasrey.com")) + itemlist.append(Item(channel=item.channel, action="peliculas", title="Recientes", url=host)) + itemlist.append(Item(channel=item.channel, action="PorFecha", title="Año de Lanzamiento", url=host)) + itemlist.append(Item(channel=item.channel, action="Idiomas", title="Idiomas", url=host)) + itemlist.append(Item(channel=item.channel, action="calidades", title="Por calidad", url=host)) + itemlist.append(Item(channel=item.channel, action="generos", title="Por género", url=host)) + itemlist.append(Item(channel=item.channel, action="search", title="Buscar...", url=host)) return itemlist @@ -31,7 +31,6 @@ def PorFecha(item): # Descarga la pagina data = httptools.downloadpage(item.url).data data = scrapertools.find_single_match(data, '
(.*?)
') - logger.info("data=" + data) # Extrae las entradas (carpetas) patron = '(.*?)') - logger.info("data=" + data) # Extrae las entradas (carpetas) patron = '(.*?)') - logger.info("data=" + data) # Extrae las entradas (carpetas) patron = '(.*?)') - logger.info("data=" + data) - - # Extrae las entradas (carpetas) patron = '([^<]+).*?(.*?)<' - matches = re.compile(patron, re.DOTALL).findall(data) itemlist = [] + itemtemp = [] for scrapedurl, nombre_servidor, idioma, calidad in matches: idioma = idioma.strip() calidad = calidad.strip() - - title = "Ver en " + nombre_servidor + " (" + idioma + ") (Calidad " + calidad + ")" - url = scrapedurl - thumbnail = "" - plot = "" - logger.debug("title=[" + title + "], url=[" + url + "], thumbnail=[" + thumbnail + "]") - itemlist.append(Item(channel=item.channel, action="play", title=title, url=url, thumbnail=thumbnail, plot=plot, - folder=False)) - - return itemlist - - -def play(item): - logger.info("url=" + item.url) - - itemlist = servertools.find_video_items(data=item.url) - - for videoitem in itemlist: - videoitem.title = item.title - videoitem.fulltitle = item.fulltitle - videoitem.thumbnail = item.thumbnail - videoitem.channel = item.channel - + if "youapihd" in nombre_servidor.lower(): + nombre_servidor = "gvideo" + if "pelismundo" in scrapedurl: + data = httptools.downloadpage(scrapedurl, add_referer = True).data + patron = 'sources.*?}],' + bloque = scrapertools.find_single_match(data, patron) + patron = 'file.*?"([^"]+)".*?label:"([^"]+)"' + match = scrapertools.find_multiple_matches(bloque, patron) + for scrapedurl1, scrapedlabel1 in match: + itemtemp.append([scrapedlabel1, scrapedurl1]) + itemtemp.sort(key=lambda it: int(it[0].replace("p", ""))) + for videoitem in itemtemp: + itemlist.append(Item(channel = item.channel, + action = "play", + extra = "hdvids", + fulltitle = item.title, + server = "directo", + thumbnail = item.thumbnail, + title = "Ver en " + nombre_servidor + " (" + idioma + ") (Calidad " + videoitem[0] + ")", + url = videoitem[1] + )) + else: + itemlist.append(Item(channel=item.channel, + action = "play", + extra = "", + fulltitle = item.title, + server = "", + title = "Ver en " + nombre_servidor + " (" + idioma + ") (Calidad " + calidad + ")", + thumbnail = item.thumbnail, + url = scrapedurl, + folder = False + )) + itemlist = servertools.get_servers_itemlist(itemlist) return itemlist From 3a7337b8058b23984284e3a9ba2c291e07a71a71 Mon Sep 17 00:00:00 2001 From: Intel1 Date: Mon, 28 Aug 2017 17:50:31 -0500 Subject: [PATCH 6/6] Update kingvid.py --- plugin.video.alfa/servers/kingvid.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.video.alfa/servers/kingvid.py b/plugin.video.alfa/servers/kingvid.py index 956bd6ff..14489900 100755 --- a/plugin.video.alfa/servers/kingvid.py +++ b/plugin.video.alfa/servers/kingvid.py @@ -11,7 +11,7 @@ def test_video_exists(page_url): data = httptools.downloadpage(page_url).data if "watch " in data.lower(): - return False, "[kingvid] El archivo no existe o ha sido borrado" + return False, "[kingvid] El archivo no existe o ha sido borrado" return True, "" @@ -19,7 +19,7 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url).data + data = httptools.downloadpage(page_url, add_referer = True).data match = scrapertools.find_single_match(data, "") data = jsunpack.unpack(match)