From 5a2d65bfbfab8fda1fd999219a9447a0294e1004 Mon Sep 17 00:00:00 2001 From: Intel1 Date: Fri, 4 Aug 2017 09:20:46 -0500 Subject: [PATCH 01/11] vidlox: Nuevo server Nuevo server --- plugin.video.alfa/servers/vidlox.json | 49 +++++++++++++++++++++++++++ plugin.video.alfa/servers/vidlox.py | 32 +++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 plugin.video.alfa/servers/vidlox.json create mode 100644 plugin.video.alfa/servers/vidlox.py diff --git a/plugin.video.alfa/servers/vidlox.json b/plugin.video.alfa/servers/vidlox.json new file mode 100644 index 00000000..5f4fbcc7 --- /dev/null +++ b/plugin.video.alfa/servers/vidlox.json @@ -0,0 +1,49 @@ +{ + "active": true, + "changes": [ + { + "date": "03/08/2017", + "description": "Versión inicial" + } + ], + "find_videos": { + "ignore_urls": [], + "patterns": [ + { + "pattern": "https://vidlox.tv/embed-.*?.html", + "url": "\\1" + } + ] + }, + "free": true, + "id": "vidlox", + "name": "vidlox", + "settings": [ + { + "default": false, + "enabled": true, + "id": "black_list", + "label": "Incluir en lista negra", + "type": "bool", + "visible": true + }, + { + "default": 0, + "enabled": true, + "id": "favorites_servers_list", + "label": "Incluir en lista de favoritos", + "lvalues": [ + "No", + "1", + "2", + "3", + "4", + "5" + ], + "type": "list", + "visible": false + } + ], + "thumbnail": "https://s1.postimg.org/wathgtvin/logo-vidlox1.png", + "version": 1 +} \ No newline at end of file diff --git a/plugin.video.alfa/servers/vidlox.py b/plugin.video.alfa/servers/vidlox.py new file mode 100644 index 00000000..087abcc2 --- /dev/null +++ b/plugin.video.alfa/servers/vidlox.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Alfa addon - KODI Plugin +# Conector para vidlox +# https://github.com/alfa-addon +# ------------------------------------------------------------ + +from core import httptools +from core import logger +from core import scrapertools + + +def test_video_exists(page_url): + logger.info("(page_url='%s')" % page_url) + data = httptools.downloadpage(page_url).data + if "borrado" in data: + return False, "[vidlox] El fichero ha sido borrado" + + return True, "" + + +def get_video_url(page_url, user="", password="", video_password=""): + logger.info("(page_url='%s')" % page_url) + video_urls = [] + data = httptools.downloadpage(page_url).data + bloque = scrapertools.find_single_match(data, 'sources:.\[.*?]') + matches = scrapertools.find_multiple_matches(bloque, '(http.*?)"') + for videourl in matches: + extension = extension = scrapertools.get_filename_from_url(videourl)[-4:] + video_urls.append(["%s [vidlox]" %extension, videourl]) + + return video_urls From 4a41c6a528c0e53c44b3a35f31b5983e60323209 Mon Sep 17 00:00:00 2001 From: Intel1 Date: Fri, 4 Aug 2017 09:23:19 -0500 Subject: [PATCH 02/11] Update cinetux.py --- plugin.video.alfa/channels/cinetux.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugin.video.alfa/channels/cinetux.py b/plugin.video.alfa/channels/cinetux.py index afe793c5..be54cd12 100644 --- a/plugin.video.alfa/channels/cinetux.py +++ b/plugin.video.alfa/channels/cinetux.py @@ -372,13 +372,10 @@ def play(item): elif "links" in item.url or "www.cinetux.me" in item.url: data = httptools.downloadpage(item.url).data scrapedurl = scrapertools.find_single_match(data, ' Date: Fri, 4 Aug 2017 12:09:32 -0500 Subject: [PATCH 03/11] put in order the episodes starting from 1x01 in matches[::-1]: set episodes in order --- plugin.video.alfa/channels/metaserie.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.video.alfa/channels/metaserie.py b/plugin.video.alfa/channels/metaserie.py index 8008c81b..192266cf 100644 --- a/plugin.video.alfa/channels/metaserie.py +++ b/plugin.video.alfa/channels/metaserie.py @@ -174,7 +174,7 @@ def episodiosxtemp(item): patron = '

([^<]+).*?td>' matches = re.compile(patron, re.DOTALL).findall(data) - for scrapedurl, scrapedtitle in matches: + for scrapedurl, scrapedtitle in matches[::-1]: url = scrapedurl contentEpisodeNumber = re.findall(r'.*?x([^\/]+)\/', url) title = scrapedtitle From 8ff6aecba4ca35a3c02b313a9fea16becfe05778 Mon Sep 17 00:00:00 2001 From: Intel1 Date: Fri, 4 Aug 2017 12:31:12 -0500 Subject: [PATCH 04/11] Update vidlox.json --- plugin.video.alfa/servers/vidlox.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.video.alfa/servers/vidlox.json b/plugin.video.alfa/servers/vidlox.json index 5f4fbcc7..f3d1e845 100644 --- a/plugin.video.alfa/servers/vidlox.json +++ b/plugin.video.alfa/servers/vidlox.json @@ -10,7 +10,7 @@ "ignore_urls": [], "patterns": [ { - "pattern": "https://vidlox.tv/embed-.*?.html", + "pattern": "(https://vidlox.tv/embed-.*?.html)", "url": "\\1" } ] @@ -46,4 +46,4 @@ ], "thumbnail": "https://s1.postimg.org/wathgtvin/logo-vidlox1.png", "version": 1 -} \ No newline at end of file +} From c331a224d30ea5f92a96ca07b90d33397cb38181 Mon Sep 17 00:00:00 2001 From: j2331223 Date: Fri, 4 Aug 2017 23:06:43 +0200 Subject: [PATCH 05/11] =?UTF-8?q?Fix=20PlayMax:=20B=C3=BAsqueda=20y=20epis?= =?UTF-8?q?odios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/channels/playmax.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin.video.alfa/channels/playmax.py b/plugin.video.alfa/channels/playmax.py index 0deb6df6..5fa6c834 100644 --- a/plugin.video.alfa/channels/playmax.py +++ b/plugin.video.alfa/channels/playmax.py @@ -142,6 +142,7 @@ def busqueda(item): data = xml2dict(data) for f in data["Data"]["Fichas"]["Ficha"]: + f["Title"] = f["Title"].replace("", "") title = "%s (%s)" % (f["Title"], f["Year"]) infolab = {'year': f["Year"]} thumbnail = f["Poster"] @@ -299,7 +300,7 @@ def fichas(item): # data = re.sub(r"\n|\r|\t|\s{2}|-\s", "", data) fichas_marca = {'1': 'Siguiendo', '2': 'Pendiente', '3': 'Favorita', '4': 'Vista', '5': 'Abandonada'} - patron = '
(?:
([^<]+)
|)([^<]+)
' matches = scrapertools.find_multiple_matches(data, patron) @@ -776,7 +777,7 @@ def acciones_cuenta(item): for category, contenido in matches: itemlist.append(item.clone(action="", title=category, text_color=color3)) - patron = '
.*?href="\.([^"]+)".*?src="\.([^"]+)".*?serie="([^"]*)".*?' \ + patron = '
]*>[^<]*<[^>]+href="\.([^"]+)".*?src="\.([^"]+)".*?serie="([^"]*)".*?' \ '
(?:
([^<]+)
|)([^<]+)
' entradas = scrapertools.find_multiple_matches(contenido, patron) for scrapedurl, scrapedthumbnail, serie, episodio, scrapedtitle in entradas: From a590f29f1cfe622c8efe7222fe7f623f495ab62e Mon Sep 17 00:00:00 2001 From: j2331223 Date: Fri, 4 Aug 2017 23:16:47 +0200 Subject: [PATCH 06/11] Recover -data --- plugin.video.alfa/channels/playmax.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.video.alfa/channels/playmax.py b/plugin.video.alfa/channels/playmax.py index 5fa6c834..6b705e94 100644 --- a/plugin.video.alfa/channels/playmax.py +++ b/plugin.video.alfa/channels/playmax.py @@ -300,7 +300,7 @@ def fichas(item): # data = re.sub(r"\n|\r|\t|\s{2}|-\s", "", data) fichas_marca = {'1': 'Siguiendo', '2': 'Pendiente', '3': 'Favorita', '4': 'Vista', '5': 'Abandonada'} - patron = '
]*>[^<]*<[^>]+href="\.([^"]+)".*?src="\.([^"]+)".*?' \ + patron = '
]*>[^<]*<[^>]+href="\.([^"]+)".*?src-data="\.([^"]+)".*?' \ '
(?:
([^<]+)
|)([^<]+)
' matches = scrapertools.find_multiple_matches(data, patron) @@ -984,4 +984,4 @@ def xml2dict(xmldata): return_dict[tag] = value - return return_dict \ No newline at end of file + return return_dict From b9abd375af854fd40aa9b640ac3af7297d88beb1 Mon Sep 17 00:00:00 2001 From: alfa-addon Date: Fri, 4 Aug 2017 19:56:54 -0400 Subject: [PATCH 07/11] no mostraba 1 unico resultado --- plugin.video.alfa/channels/playmax.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/plugin.video.alfa/channels/playmax.py b/plugin.video.alfa/channels/playmax.py index 6b705e94..b1416ca8 100644 --- a/plugin.video.alfa/channels/playmax.py +++ b/plugin.video.alfa/channels/playmax.py @@ -4,7 +4,6 @@ import re from core import config from core import httptools -from core import jsontools as json from core import logger from core import scrapertools from core import tmdb @@ -124,6 +123,7 @@ def mainlist(item): def search(item, texto): logger.info() + texto = texto.replace(" ", "%20") item.url = "%s/buscar.php?apikey=%s&sid=%s&buscar=%s&modo=[fichas]&start=0" % (host, apikey, sid, texto) try: return busqueda(item) @@ -140,8 +140,12 @@ def busqueda(item): data = httptools.downloadpage(item.url).data data = xml2dict(data) + if type(data["Data"]["Fichas"]["Ficha"]) == dict: + searched_data = [data["Data"]["Fichas"]["Ficha"]] + else: + searched_data = data["Data"]["Fichas"]["Ficha"] - for f in data["Data"]["Fichas"]["Ficha"]: + for f in searched_data: f["Title"] = f["Title"].replace("", "") title = "%s (%s)" % (f["Title"], f["Year"]) infolab = {'year': f["Year"]} @@ -158,14 +162,13 @@ def busqueda(item): else: tipo = "movie" show = "" - itemlist.append(Item(channel=item.channel, action=action, title=title, url=url, text_color=color2, contentTitle=f["Title"], show=show, contentType=tipo, infoLabels=infolab, thumbnail=thumbnail)) if __modo_grafico__: tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) - + # total = int(data.get("Data", {}).get("totalResultsFichas"), "0") total = int(data["Data"]["totalResultsFichas"]) actualpage = int(scrapertools.find_single_match(item.url, "start=(\d+)")) if actualpage + 20 < total: @@ -220,7 +223,7 @@ def newest(categoria): except: import sys for line in sys.exc_info(): - logger.error("{0}".format(line)) + logger.error("%s" %line) return [] return itemlist @@ -941,17 +944,9 @@ def xml2dict(xmldata): Un diccionario construido a partir de los campos del XML. """ - from core import filetools import sys parse = globals().get(sys._getframe().f_code.co_name) - # if xmldata is None and file is None: - # raise Exception("No hay nada que convertir!") - # elif xmldata is None: - # if not filetools.exists(file): - # raise Exception("El archivo no existe!") - # xmldata = open(file, "rb").read() - matches = re.compile("<(?P[^>]+)>[\n]*[\s]*[\t]*(?P.*?)[\n]*[\s]*[\t]*<\/(?P=tag)\s*>", re.DOTALL).findall(xmldata) From 38085f9acb615ce698025e0c51c407f0f54bd4f5 Mon Sep 17 00:00:00 2001 From: alfa-addon Date: Fri, 4 Aug 2017 20:05:47 -0400 Subject: [PATCH 08/11] fix mostrar 1 solo resultado --- plugin.video.alfa/channels/playmax.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.video.alfa/channels/playmax.py b/plugin.video.alfa/channels/playmax.py index b1416ca8..64c6e5db 100644 --- a/plugin.video.alfa/channels/playmax.py +++ b/plugin.video.alfa/channels/playmax.py @@ -168,7 +168,7 @@ def busqueda(item): if __modo_grafico__: tmdb.set_infoLabels_itemlist(itemlist, __modo_grafico__) - # total = int(data.get("Data", {}).get("totalResultsFichas"), "0") + total = int(data["Data"]["totalResultsFichas"]) actualpage = int(scrapertools.find_single_match(item.url, "start=(\d+)")) if actualpage + 20 < total: From f41b73d0514492e6f6a70681bba33d26415bfd04 Mon Sep 17 00:00:00 2001 From: alfa-addon Date: Fri, 4 Aug 2017 20:06:51 -0400 Subject: [PATCH 09/11] fixes menores --- plugin.video.alfa/channels/anitoonstv.py | 3 +-- plugin.video.alfa/channels/cartoonlatino.py | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) mode change 100755 => 100644 plugin.video.alfa/channels/anitoonstv.py mode change 100755 => 100644 plugin.video.alfa/channels/cartoonlatino.py diff --git a/plugin.video.alfa/channels/anitoonstv.py b/plugin.video.alfa/channels/anitoonstv.py old mode 100755 new mode 100644 index 3fbfdd73..b13ea9f4 --- a/plugin.video.alfa/channels/anitoonstv.py +++ b/plugin.video.alfa/channels/anitoonstv.py @@ -3,7 +3,6 @@ import re from channels import renumbertools -from channelselector import get_thumb from core import config from core import httptools from core import logger @@ -17,7 +16,7 @@ host = "http://www.anitoonstv.com" def mainlist(item): logger.info() - thumb_series = get_thumb("thumb_channels_tvshow.png") + thumb_series = config.get_thumb("thumb_channels_tvshow.png") itemlist = list() diff --git a/plugin.video.alfa/channels/cartoonlatino.py b/plugin.video.alfa/channels/cartoonlatino.py old mode 100755 new mode 100644 index 4f28dd32..8731a83a --- a/plugin.video.alfa/channels/cartoonlatino.py +++ b/plugin.video.alfa/channels/cartoonlatino.py @@ -3,7 +3,6 @@ import re from channels import renumbertools -from channelselector import get_thumb from core import config from core import httptools from core import logger @@ -18,8 +17,8 @@ host = "http://www.cartoon-latino.com/" def mainlist(item): logger.info() - thumb_series = get_thumb("thumb_channels_tvshow.png") - thumb_series_az = get_thumb("thumb_channels_tvshow_az.png") + thumb_series = config.get_thumb("thumb_channels_tvshow.png") + thumb_series_az = config.get_thumb("thumb_channels_tvshow_az.png") itemlist = list() From b6714e7f7a6d438d5fc06fa5745db890083adf2a Mon Sep 17 00:00:00 2001 From: alfa-addon Date: Fri, 4 Aug 2017 20:10:31 -0400 Subject: [PATCH 10/11] =?UTF-8?q?fix=20secci=C3=B3n=20de=20series?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/channels/allpeliculas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 plugin.video.alfa/channels/allpeliculas.py diff --git a/plugin.video.alfa/channels/allpeliculas.py b/plugin.video.alfa/channels/allpeliculas.py old mode 100755 new mode 100644 index 3dd0fff2..71c40b70 --- a/plugin.video.alfa/channels/allpeliculas.py +++ b/plugin.video.alfa/channels/allpeliculas.py @@ -402,7 +402,7 @@ def findvideostv(item): idioma = IDIOMAS.get(idiomas_videos.get(language)) titulo = "%s [" + idioma + "] (" + calidad_videos.get(quality) + ")" - itemlist.append(item.clone(action="play", title=titulo, url=url, contentType="episode", server=server)) + itemlist.append(item.clone(action="play", title=titulo, url=url, contentType="episode")) # Enlace Descarga patron = '