Re: Fallan conectores, Powvideo y Flashx
Publicado: 05 Nov 2016, 18:20
No se si haré algo mal, pero descargo el archivo powvideo.py 27,31 KB, lo pego en servers con android y spcm, y me sigue fallando.
Soporte oficial de pelisalacarta y tvalacarta - Ayuda con tu media center
https://www.mimediacenter.info/foro/
Código: Seleccionar todo
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para powvideo
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
from core.scrapertools import *
headers = [['User-Agent','Mozilla/5.0 (Windows NT 10.0; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0']]
host = "http://powvideo.net/"
def test_video_exists(page_url):
logger.info("pelisalacarta.servers.powvideo test_video_exists(page_url='%s')" % page_url)
data = cache_page(page_url)
if "<title>watch </title>" in data.lower(): return False, "[powvideo] El archivo no existe o ha sido borrado"
return True, ""
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
logger.info("pelisalacarta.servers.powvideo get_video_url(page_url='%s')" % page_url)
url = page_url.replace(host,"http://powvideo.xyz/iframe-") + "-954x562.html"
headers.append(['Referer', url.replace("iframe","preview")])
data = cache_page(url, headers=headers)
jj_encode = find_single_match(data, "(\w+=~\[\];.*?\)\(\)\)\(\);)")
jj_decode = None; jj_patron = None
if jj_encode: jj_decode = jjdecode(jj_encode)
if jj_decode: jj_patron = find_single_match(jj_decode, "/([^/]+)/")
data = find_single_match(data, "<script type=.text/javascript.>(eval.function.p,a,c,k,e.*?)</script>")
data = unPack(data).replace("\\", "")
data = find_single_match(data, "sources\s*=[^\[]*\[([^\]]+)\]")
matches = find_multiple_matches(data.replace('"', "'"), "[src|file]:'([^']+)'")
video_urls = []
for video_url in matches:
filename = get_filename_from_url(video_url)[-4:]
if video_url.startswith("rtmp"):
rtmp, playpath = video_url.split("vod/", 1)
video_url = "%s playpath=%s swfUrl=%splayer6/jwplayer.flash.swf pageUrl=%s" % (rtmp + "vod/", playpath, host, page_url)
filename = "RTMP"
elif "m3u8" in video_url:
video_url += "|User-Agent=" + headers[0][1]
video_urls.append([filename + " [powvideo]", re.sub(r'%s' % jj_patron, r'\1', video_url)])
for video_url in video_urls:
logger.info("pelisalacarta.servers.powvideo %s - %s" % (video_url[0], video_url[1]))
return video_urls
def find_videos(data):
encontrados = set()
devuelve = []
patronvideos = host + "(?:embed-|iframe-|preview-|)([a-z0-9]+)(?:-\d+[xX]\d.html|.html|)"
logger.info("pelisalacarta.servers.powvideo find_videos #" + patronvideos + "#")
matches = re.compile(patronvideos, re.DOTALL).findall(data)
for match in matches:
titulo = "[powvideo]"
url = host + match
if url not in encontrados:
logger.info(" url=" + url)
devuelve.append([titulo, url, 'powvideo'])
encontrados.add(url)
else:
logger.info(" url duplicada=" + url)
return devuelve
def unPack(packed):
pattern = "}\('(.*)', *(\d+), *(\d+), *'(.*)'\.split\('([^']+)'\)"
d = [ d for d in re.search(pattern, packed, re.DOTALL).groups() ]
p = d[0]; a = int(d[1]); c = int(d[2]); k = d[3].split(d[4])
if a <= 62: toString = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
else: toString = """ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~"""
def e(c):
return toString[c] if c < a else toString[c // a] + toString[c % a]
while c > 0:
c-= 1
if k[c]: x = e(c)
else: x = k[c]
y = k[c]
p = re.sub(r"(\b%s\b)" % x, y, p)
return p
def jjdecode(t):
x = '0123456789abcdef'
j = get_match(t, '^([^=]+)=')
t = t.replace(j + '.', 'j.')
t = re.sub(r'^.*?"\\""\+(.*?)\+"\\"".*?$', r'\1', t.replace('\\\\', '\\')) + '+""'
t = re.sub('(\(!\[\]\+""\)\[j\._\$_\])', '"l"', t)
t = re.sub(r'j\._\$\+', '"o"+', t)
t = re.sub(r'j\.__\+', '"t"+', t)
t = re.sub(r'j\._\+', '"u"+', t)
p = find_multiple_matches(t, '(j\.[^\+]+\+)')
for c in p:
t = t.replace(c, c.replace('_', '0').replace('$', '1'))
p = find_multiple_matches(t, 'j\.(\d{4})')
for c in p:
t = re.sub(r'j\.%s' % c, '"' + x[int(c, 2)] + '"', t)
p = find_multiple_matches(t, '\\"\+j\.(001)\+j\.(\d{3})\+j\.(\d{3})\+')
for c in p:
t = re.sub(r'\\"\+j\.%s\+j\.%s\+j\.%s\+' % (c[0], c[1], c[2]), chr(int("".join(c), 2)) + '"+', t)
p = find_multiple_matches(t, '\\"\+j\.(\d{3})\+j\.(\d{3})\+')
for c in p:
t = re.sub(r'\\"\+j\.%s\+j\.%s\+' % (c[0], c[1]), chr(int("".join(c),2)) + '"+', t)
p = find_multiple_matches(t, 'j\.(\d{3})')
for c in p:
t = re.sub(r'j\.%s' % c, '"' + str(int(c, 2)) + '"', t)
r = re.sub(r'"\+"|\\\\','',t[1:-1])
return r
Va como un reloj, tanto con tus funciones jjdecode y unpack, como con las de pelisalacartarobalo escribió:@Cmos te pongo un completo de powvideo para que se pueda testear
Código: Seleccionar todo
elif "m3u8" in video_url:
video_url += "|User-Agent=" + headers[0][1]
Código: Seleccionar todo
elif video_url.endswith("/v.mp4"):
video_url_flv = re.sub(r'/v.mp4$','/v.flv',video_url)
video_urls.append( [ ".flv" + " [powvideo]", re.sub(r'%s' % jj_patron, r'\1', video_url_flv)])
Código: Seleccionar todo
matches = scrapertools.find_multiple_matches(data, "<script type='text/javascript'>(.*?)</script>")
for m in matches:
if m.startswith("eval"):
try:
m = jsunpack.unpack(m)
not_fake = scrapertools.find_single_match(m, "(\w{40,})")
if not_fake:
break
except:
m = ""
match = m