From 2f973a75eb89edf188ef3d8d1810c857d5fb8c98 Mon Sep 17 00:00:00 2001 From: pipcat Date: Sat, 21 Jul 2018 21:15:54 +0200 Subject: [PATCH] =?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)