Powvideo
This commit is contained in:
@@ -15,7 +15,7 @@ headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:53.0) Gecko/2
|
|||||||
def test_video_exists(page_url):
|
def test_video_exists(page_url):
|
||||||
referer = page_url.replace('iframe', 'preview')
|
referer = page_url.replace('iframe', 'preview')
|
||||||
data = httptools.downloadpage(page_url, headers={'referer': referer}).data
|
data = httptools.downloadpage(page_url, headers={'referer': referer}).data
|
||||||
if data == "File was deleted":
|
if data == "File was deleted" or data == '':
|
||||||
return False, "[powvideo] El video ha sido borrado"
|
return False, "[powvideo] El video ha sido borrado"
|
||||||
return True, ""
|
return True, ""
|
||||||
|
|
||||||
@@ -33,26 +33,12 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
|||||||
|
|
||||||
url = scrapertools.find_single_match(unpacked, "(?:src):\\\\'([^\\\\]+.mp4)\\\\'")
|
url = scrapertools.find_single_match(unpacked, "(?:src):\\\\'([^\\\\]+.mp4)\\\\'")
|
||||||
|
|
||||||
matches = scrapertools.find_single_match(data, "\['splice'\]\(0x([0-9a-fA-F]*),0x([0-9a-fA-F]*)\);")
|
itemlist.append([".mp4" + " [powvideo]", decode_video_url(url)])
|
||||||
if matches:
|
|
||||||
url = decode_powvideo_url(url, int(matches[0], 16), int(matches[1], 16))
|
|
||||||
else:
|
|
||||||
matches = scrapertools.find_single_match(data, "\(0x([0-9a-fA-F]*),0x([0-9a-fA-F]*)\);")
|
|
||||||
if matches:
|
|
||||||
url = decode_powvideo_url(url, int(matches[0], 16), int(matches[1], 16))
|
|
||||||
else:
|
|
||||||
logger.debug('No detectado splice! Revisar sistema de decode...')
|
|
||||||
# ~ logger.debug(data)
|
|
||||||
|
|
||||||
itemlist.append([".mp4" + " [powvideo]", url])
|
|
||||||
itemlist.sort(key=lambda x: x[0], reverse=True)
|
itemlist.sort(key=lambda x: x[0], reverse=True)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def decode_powvideo_url(url, desde, num):
|
def decode_video_url(url):
|
||||||
tria = re.compile('[0-9a-z]{40,}', re.IGNORECASE).findall(url)[0]
|
tria = re.compile('[0-9a-z]{40,}', re.IGNORECASE).findall(url)[0]
|
||||||
gira = tria[::-1]
|
gira = tria[::-1]
|
||||||
if desde == 0:
|
x = gira[1:]
|
||||||
x = gira[num:]
|
|
||||||
else:
|
|
||||||
x = gira[:desde] + gira[(desde+num):]
|
|
||||||
return re.sub(tria, x, url)
|
return re.sub(tria, x, url)
|
||||||
|
|||||||
Reference in New Issue
Block a user