From 27f0375e4e5355c8c02744ae9c18bda10de1cbd8 Mon Sep 17 00:00:00 2001 From: pipcat Date: Fri, 20 Jul 2018 21:48:32 +0200 Subject: [PATCH 1/8] =?UTF-8?q?Correcci=C3=B3n=20vidoza=20y=20platformtool?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../platformcode/platformtools.py | 18 ++++----------- plugin.video.alfa/servers/vidoza.py | 23 ++++++++++++++----- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/plugin.video.alfa/platformcode/platformtools.py b/plugin.video.alfa/platformcode/platformtools.py index 506a6676..54459dba 100644 --- a/plugin.video.alfa/platformcode/platformtools.py +++ b/plugin.video.alfa/platformcode/platformtools.py @@ -127,13 +127,12 @@ def render_items(itemlist, parent_item): if 'anime' in channeltools.get_channel_parameters(parent_item.channel)['categories']: anime = True - # Recorremos el itemlist + unify_enabled = config.get_setting('unify') + #logger.debug('unify_enabled: %s' % unify_enabled) + + # Recorremos el itemlist for item in itemlist: - try: - channel_parameters = channeltools.get_channel_parameters(item.channel) - except: - pass #logger.debug(item) # Si el item no contiene categoria, le ponemos la del item padre if item.category == "": @@ -143,9 +142,7 @@ def render_items(itemlist, parent_item): if item.fanart == "": item.fanart = parent_item.fanart - if genre: - valid_genre = True thumb = get_thumb(item.title, auto=True) if thumb != '': @@ -155,12 +152,7 @@ def render_items(itemlist, parent_item): valid_genre = True - unify_enabled = config.get_setting('unify') - - #logger.debug('unify_enabled: %s' % unify_enabled) - - - if unify_enabled and not channel_parameters['adult'] and 'skip_unify' not in channel_parameters: + if unify_enabled: # Formatear titulo con unify item = unify.title_format(item) else: diff --git a/plugin.video.alfa/servers/vidoza.py b/plugin.video.alfa/servers/vidoza.py index a7b55f11..85da6413 100755 --- a/plugin.video.alfa/servers/vidoza.py +++ b/plugin.video.alfa/servers/vidoza.py @@ -20,13 +20,24 @@ 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 video_urls = [] - matches = scrapertools.find_multiple_matches(data, 'src\s*:\s*"([^"]+)".*?label:\'([^\']+)\'') - for media_url, calidad in matches: - ext = media_url[-4:] - video_urls.append(["%s %s [vidoza]" % (ext, calidad), media_url]) + + s = scrapertools.find_single_match(data, 'sourcesCode\s*:\s*(\[\{.*?\}\])') + s = s.replace('src:', '"src":').replace('type:', '"type":').replace('label:', '"label":').replace('res:', '"res":') + try: + data = json.loads(str(s)) + for enlace in data: + if 'src' in enlace: + tit = '' + if 'label' in enlace: tit += '[%s]' % enlace['label'] + if 'res' in enlace: tit += '[%s]' % enlace['res'] + if tit == '' and 'type' in enlace: tit = enlace['type'] + if tit == '': tit = '.mp4' + + video_urls.append(["%s [vidoza]" % tit, enlace['src']]) + except: + logger.debug('No se detecta json %s' % s) + pass video_urls.reverse() - for video_url in video_urls: - logger.info("%s - %s" % (video_url[0], video_url[1])) return video_urls From 982974d7f4bd0f87c4b010a93f4aed02f97897ab Mon Sep 17 00:00:00 2001 From: pipcat Date: Sat, 21 Jul 2018 18:43:34 +0200 Subject: [PATCH 2/8] =?UTF-8?q?Correcci=C3=B3n=20vidoza?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/servers/vidoza.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin.video.alfa/servers/vidoza.py b/plugin.video.alfa/servers/vidoza.py index 85da6413..3d71ec35 100755 --- a/plugin.video.alfa/servers/vidoza.py +++ b/plugin.video.alfa/servers/vidoza.py @@ -3,6 +3,7 @@ from core import httptools from core import scrapertools from platformcode import logger +import json def test_video_exists(page_url): From 22cb47a8c34dd10385bfeec51469859679ec75e0 Mon Sep 17 00:00:00 2001 From: pipcat Date: Sat, 21 Jul 2018 18:54:29 +0200 Subject: [PATCH 3/8] =?UTF-8?q?Correcci=C3=B3n=20powvideo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/servers/powvideo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.video.alfa/servers/powvideo.py b/plugin.video.alfa/servers/powvideo.py index 2696c972..1ccfd16b 100755 --- a/plugin.video.alfa/servers/powvideo.py +++ b/plugin.video.alfa/servers/powvideo.py @@ -39,5 +39,5 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= def decode_powvideo_url(url): tria = re.compile('[0-9a-z]{40,}', re.IGNORECASE).findall(url)[0] gira = tria[::-1] - x = gira[:1] + gira[2:] + x = gira[:2] + gira[3:] return re.sub(tria, x, url) From f22dbac329b0a41f0e3fbce95e3c96cfc16cb01d Mon Sep 17 00:00:00 2001 From: pipcat Date: Sat, 21 Jul 2018 20:27:45 +0200 Subject: [PATCH 4/8] Vidoza con jsontools para que no falle en windows --- plugin.video.alfa/servers/vidoza.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin.video.alfa/servers/vidoza.py b/plugin.video.alfa/servers/vidoza.py index 3d71ec35..91f18fce 100755 --- a/plugin.video.alfa/servers/vidoza.py +++ b/plugin.video.alfa/servers/vidoza.py @@ -3,7 +3,7 @@ from core import httptools from core import scrapertools from platformcode import logger -import json +from core import jsontools def test_video_exists(page_url): @@ -25,7 +25,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= s = scrapertools.find_single_match(data, 'sourcesCode\s*:\s*(\[\{.*?\}\])') s = s.replace('src:', '"src":').replace('type:', '"type":').replace('label:', '"label":').replace('res:', '"res":') try: - data = json.loads(str(s)) + data = jsontools.load(s) for enlace in data: if 'src' in enlace: tit = '' From 2f973a75eb89edf188ef3d8d1810c857d5fb8c98 Mon Sep 17 00:00:00 2001 From: pipcat Date: Sat, 21 Jul 2018 21:15:54 +0200 Subject: [PATCH 5/8] =?UTF-8?q?Powvideo=20m=C3=A1s=20variable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/servers/powvideo.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/plugin.video.alfa/servers/powvideo.py b/plugin.video.alfa/servers/powvideo.py index 1ccfd16b..74336d7c 100755 --- a/plugin.video.alfa/servers/powvideo.py +++ b/plugin.video.alfa/servers/powvideo.py @@ -30,14 +30,24 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= packed = scrapertools.find_single_match(data, "") unpacked = jsunpack.unpack(packed) - + url = scrapertools.find_single_match(unpacked, "(?:src):\\\\'([^\\\\]+.mp4)\\\\'") - itemlist.append([".mp4" + " [powvideo]", decode_powvideo_url(url)]) + + a, b = scrapertools.find_single_match(data, "\['splice'\]\(0x([0-9a-fA-F]*),0x([0-9a-fA-F]*)\);") + if a and b: + url = decode_powvideo_url(url, int(a, 16), int(b, 16)) + else: + logger.debug('No detectado splice! Revisar sistema de decode...') + + itemlist.append([".mp4" + " [powvideo]", url]) itemlist.sort(key=lambda x: x[0], reverse=True) return itemlist -def decode_powvideo_url(url): +def decode_powvideo_url(url, desde, num): tria = re.compile('[0-9a-z]{40,}', re.IGNORECASE).findall(url)[0] gira = tria[::-1] - x = gira[:2] + gira[3:] + if desde == 0: + x = gira[num:] + else: + x = gira[:desde] + gira[(desde+num):] return re.sub(tria, x, url) From 31bbe6aa485dc0b385e45c88cb11978cdd0dbf60 Mon Sep 17 00:00:00 2001 From: pipcat Date: Sun, 22 Jul 2018 12:45:35 +0200 Subject: [PATCH 6/8] Vidoza, detectar tb file: --- plugin.video.alfa/servers/vidoza.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin.video.alfa/servers/vidoza.py b/plugin.video.alfa/servers/vidoza.py index 91f18fce..934b902d 100755 --- a/plugin.video.alfa/servers/vidoza.py +++ b/plugin.video.alfa/servers/vidoza.py @@ -23,18 +23,19 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= video_urls = [] s = scrapertools.find_single_match(data, 'sourcesCode\s*:\s*(\[\{.*?\}\])') - s = s.replace('src:', '"src":').replace('type:', '"type":').replace('label:', '"label":').replace('res:', '"res":') + s = s.replace('src:', '"src":').replace('file:', '"file":').replace('type:', '"type":').replace('label:', '"label":').replace('res:', '"res":') try: data = jsontools.load(s) for enlace in data: - if 'src' in enlace: + if 'src' in enlace or 'file' in enlace: + url = enlace['src'] if 'src' in enlace else enlace['file'] tit = '' if 'label' in enlace: tit += '[%s]' % enlace['label'] if 'res' in enlace: tit += '[%s]' % enlace['res'] if tit == '' and 'type' in enlace: tit = enlace['type'] if tit == '': tit = '.mp4' - video_urls.append(["%s [vidoza]" % tit, enlace['src']]) + video_urls.append(["%s [vidoza]" % tit, url]) except: logger.debug('No se detecta json %s' % s) pass From 48bbe3beecf4d937be20a5890981c7a5a6e5ec7b Mon Sep 17 00:00:00 2001 From: pipcat Date: Sun, 22 Jul 2018 14:06:44 +0200 Subject: [PATCH 7/8] =?UTF-8?q?Correcci=C3=B3n=20gamovideo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin.video.alfa/servers/gamovideo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin.video.alfa/servers/gamovideo.py b/plugin.video.alfa/servers/gamovideo.py index cbb32783..5058b59c 100755 --- a/plugin.video.alfa/servers/gamovideo.py +++ b/plugin.video.alfa/servers/gamovideo.py @@ -7,12 +7,12 @@ from core import scrapertools from lib import jsunpack from platformcode import logger -headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:58.0) Gecko/20100101 Firefox/58.0'} +headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'} def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url).data + data = httptools.downloadpage(page_url, headers=headers).data if "File was deleted" in data or "Not Found" in data or "File was locked by administrator" in data: return False, "[Gamovideo] El archivo no existe o ha sido borrado" @@ -25,7 +25,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, headers=headers).data packer = scrapertools.find_single_match(data, "") if packer != "": From b621840d224d734fc89f6b7dcb1431968ef4b60a Mon Sep 17 00:00:00 2001 From: pipcat Date: Tue, 24 Jul 2018 09:18:48 +0200 Subject: [PATCH 8/8] Gamovideo corregido en httptools --- plugin.video.alfa/core/httptools.py | 2 +- plugin.video.alfa/servers/gamovideo.py | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/plugin.video.alfa/core/httptools.py b/plugin.video.alfa/core/httptools.py index ee9195dc..ba6ddde2 100755 --- a/plugin.video.alfa/core/httptools.py +++ b/plugin.video.alfa/core/httptools.py @@ -28,7 +28,7 @@ ficherocookies = os.path.join(config.get_data_path(), "cookies.dat") # Headers por defecto, si no se especifica nada default_headers = dict() -default_headers["User-Agent"] = "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3163.100 Safari/537.36" +default_headers["User-Agent"] = "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3163.100 Safari/537.36" default_headers["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8" default_headers["Accept-Language"] = "es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3" default_headers["Accept-Charset"] = "UTF-8" diff --git a/plugin.video.alfa/servers/gamovideo.py b/plugin.video.alfa/servers/gamovideo.py index 5058b59c..b67149ff 100755 --- a/plugin.video.alfa/servers/gamovideo.py +++ b/plugin.video.alfa/servers/gamovideo.py @@ -7,12 +7,10 @@ from core import scrapertools from lib import jsunpack from platformcode import logger -headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36'} - def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url, headers=headers).data + data = httptools.downloadpage(page_url).data if "File was deleted" in data or "Not Found" in data or "File was locked by administrator" in data: return False, "[Gamovideo] El archivo no existe o ha sido borrado" @@ -25,7 +23,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, headers=headers).data + data = httptools.downloadpage(page_url).data packer = scrapertools.find_single_match(data, "") if packer != "":