Página 6 de 19

Re: Fallan conectores, Powvideo y Flashx

Publicado: 21 Nov 2016, 21:50
por robalo
El poner sólo el fix es porque mis archivos son diferendes y se puede liar parda :). Aún posteando sólo un posible fix para que se vea como se podría proceder, tengo que editar las líneas y es rara la vez que no se me cuela algo. Somos muchos y seguro que entre tanta gente (no sólo Cmos) alguno lo intentará. Paciencia :)

Re: Fallan conectores, Powvideo y Flashx

Publicado: 21 Nov 2016, 22:00
por calihops
Pues tendremos paciencia, gracias.

Re: Fallan conectores, Powvideo y Flashx

Publicado: 22 Nov 2016, 18:50
por DanielyD
oye pero yo copie el .py de powvideo y me dice, no hay nada para reproducir, gracias, que pena incomodarlos tanto

Re: Fallan conectores, Powvideo y Flashx

Publicado: 22 Nov 2016, 20:05
por robalo
DanielyD http://www.mimediacenter.info/foro/viewtopic.php?f=24&t=4689&start=230#p36282 escribió:Buenas tardes, no se que tan fácil sea agregar estos canales, pero se ven como buenos, si algo también deseo colaborar, pero no se mucho, solo programar jeje
http://www.batmanonlinelatino.com.mx/
http://www.limatoons.com/
No se yo quien es el que se "incomada". Yo no soy programador y no me "incomoda" ;)

Re: Fallan conectores, Powvideo y Flashx

Publicado: 25 Nov 2016, 09:29
por dariomo
robalo escribió:streamplay:

Código: Seleccionar todo

[....]
    jj_encode = find_single_match(data, "(\w+=~\[\];.*?\)\(\)\)\(\);)")
    ## -- Añadida la variable 'reverse' -------------------------------
    jj_decode = None; jj_patron = None; reverse = False
    ## -- -------------------------------------------------------------
    if jj_encode: jj_decode = jjdecode(jj_encode)
    if jj_decode: jj_patron = find_single_match(jj_decode, "/([^/]+)/")

    ## -- Nuevo -------------------------------------------------------
    if not "(" in jj_patron: jj_patron = "(" + jj_patron
    if not ")" in jj_patron: jj_patron+= ")"
    if "x72x65x76x65x72x73x65" in jj_decode: reverse = True
    ## -- -------------------------------------------------------------
[....]
    video_urls = []
    for video_url in matches:
        ## -- Nuevo ---------------------------------------------------
        if reverse:
            reverse = find_single_match(video_url, '\w{40,}')[::-1]
            video_url = re.sub(r'\w{40,}', reverse, video_url)
        ## -- ---------------------------------------------------------
[....]
EDITO: El code está con 'from core.scrapertools import *'. Los 'find_single_match' se tiene que modificar por 'scrapertools.find_single_match' si se usa 'from core import scrapertools'

Gracias Compañero.

Podrías explicar en que parte del .py colocarlo, y que es lo que sustituye??... estoy un poco perdido jejeje... lo he intentado y me salta error al abrir

Gracias como siempre x tu ayuda.

Re: Fallan conectores, Powvideo y Flashx

Publicado: 25 Nov 2016, 09:46
por dariomo
Saludos.

Ya he conseguido que al menos no me de error al entrar jejeje... pero no consigo que funcione.

Tengo el StreamPlay así:

Código: Seleccionar todo

# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para streamplay
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------

import re

from jjdecode import JJDecoder
from core import jsunpack
from core import logger
from core import scrapertools


def test_video_exists( page_url ):
    logger.info("pelisalacarta.streamplay test_video_exists(page_url='%s')" % page_url)
    data = scrapertools.cache_page(page_url)
    if data == "File was deleted":
        return False, "[Streamplay] 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.streamplay get_video_url(page_url='%s')" % page_url)
    data = scrapertools.cache_page(page_url)

    jj_encode = scrapertools.find_single_match(data, "(\w+=~\[\];.*?\)\(\)\)\(\);)")
    ## -- Añadida la variable 'reverse' -------------------------------
    jj_decode = None; jj_patron = None; reverse = False
    ## -- -------------------------------------------------------------
    if jj_encode: jj_decode = jjdecode(jj_encode)
    if jj_decode: jj_patron = scrapertools.find_single_match(jj_decode, "/([^/]+)/")

    ## -- Nuevo -------------------------------------------------------
    if not "(" in jj_patron: jj_patron = "(" + jj_patron
    if not ")" in jj_patron: jj_patron+= ")"
    if "x72x65x76x65x72x73x65" in jj_decode: reverse = True
    ## -- -------------------------------------------------------------

    matches = scrapertools.find_single_match(data, "<script type=[\"']text/javascript[\"']>(eval.*?)</script>")
    matchjs = jsunpack.unpack(matches).replace("\\", "")

    matches = scrapertools.find_multiple_matches(matchjs, ',file:"([^"]+)"')
     video_urls = []
    for video_url in matches:
        ## -- Nuevo ---------------------------------------------------
        if reverse:
            reverse = scrapertools.find_single_match(video_url, '\w{40,}')[::-1]
            video_url = re.sub(r'\w{40,}', reverse, video_url)
        ## -- ---------------------------------------------------------

        mediaurl = re.sub(r'%s' % jj_patron, r'\1', mediaurl)
        video_urls.append([filename + " [streamplay]", mediaurl])

    video_urls.sort(key=lambda x:x[0], reverse=True)
    for video_url in video_urls:
        logger.info("[streamplay.py] %s - %s" % (video_url[0], video_url[1]))

    return video_urls


# Encuentra vídeos del servidor en el texto pasado
def find_videos(data):
    encontrados = set()
    devuelve = []

    # http://streamplay.to/ubhrqw1drwlx
    patronvideos = "streamplay.to/(?:embed-|)([a-z0-9]+)(?:.html|)"
    logger.info("pelisalacarta.streamplay find_videos #"+patronvideos+"#")
    matches = re.compile(patronvideos, re.DOTALL).findall(data)

    for match in matches:
        titulo = "[streamplay]"
        url = "http://streamplay.to/embed-%s.html" % match
        if url not in encontrados:
            logger.info("  url="+url)
            devuelve.append([titulo, url, 'streamplay'])
            encontrados.add(url)
        else:
            logger.info("  url duplicada="+url)

    return devuelve
Me dice que No Hay nada que reproducir... ¿Alguien sabe que hago mal?

Saludos y Gracias.

Re: Fallan conectores, Powvideo y Flashx

Publicado: 25 Nov 2016, 23:28
por robalo
Hay un nuevo cambio en streamplay, no se si empezó ayer o hoy.

Os dejo el py que uso pero con las librerias que uso insertadas dentro del archivo para que poáis probarlo hasta que alguien lo adapte a la versión del github o para que alguno la adapte a la suya si es diferente

Código: Seleccionar todo

# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para streamplay
# 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','streamplay.to'],
 ]
host = "http://streamplay.to/"

def test_video_exists(page_url):
    logger.info("pelisalacarta.streamplay test_video_exists(page_url='%s')" % page_url)

    data = cache_page(page_url)
    if "<title>watch </title>" in data.lower(): return False, "[Streamplay] 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.streamplay get_video_url(page_url='%s')" % page_url)

    url = page_url.replace(host, host + "embed-") + ".html"
    data = cache_page(url)

    '''
    data = cache_page(page_url, headers=headers)
    data = find_multiple_matches(data.replace('"',"'"), "name='([^']+)'\s*value='([^']*)'")
    post = urllib.urlencode({k:v for k, v in data})
    import time
    time.sleep(5)
    data = cache_page(page_url, post=post, headers=headers+[['Referer',page_url]])
    '''

    jj_encode = find_single_match(data, "(\w+=~\[\];.*?\)\(\)\)\(\);)")
    jj_decode = None; jj_patron = None; reverse = False; substring = False
    if jj_encode: jj_decode = jjdecode(jj_encode)
    if jj_decode: jj_patron = find_single_match(jj_decode, "/([^/]+)/")
    if not "(" in jj_patron: jj_patron = "(" + jj_patron
    if not ")" in jj_patron: jj_patron+= ")"

    if "x72x65x76x65x72x73x65" in jj_decode: reverse = True
    if "x73x75x62x73x74x72x69x6Ex67" in jj_decode: substring = True

    data = find_single_match(data, "<script type=.text/javascript.>(eval\(function\(p,a,c,k,e,d.*?)</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:
        _hash = find_single_match(video_url, '\w{40,}')
        if substring:
            substring = int(find_single_match(jj_decode, "_\w+.\d...(\d)...;"))
            if reverse: _hash = _hash[:-substring]
            else: _hash = _hash[substring:]
        if reverse: video_url = re.sub(r'\w{40,}', _hash[::-1], video_url)
        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]
        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)])

        video_urls.append( [ filename + " [powvideo]", re.sub(r'%s' % jj_patron, r'\1', video_url)])

    for video_url in video_urls:
        logger.info("[streamplay.py] %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.streamplay find_videos #" + patronvideos + "#")
    matches = re.compile(patronvideos, re.DOTALL).findall(data)

    for match in matches:
        titulo = "[streamplay]"
        url = host + match
        if url not in encontrados:
            logger.info("  url=" + url)
            devuelve.append([titulo, url, 'streamplay'])
            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

Re: Fallan conectores, Powvideo y Flashx

Publicado: 26 Nov 2016, 10:12
por dariomo
Muchas Gracias Robalo... Me funciona perfecto.


Saludos.

Re: Fallan conectores, Powvideo y Flashx

Publicado: 26 Nov 2016, 11:34
por elrules
Flashx vuelve a fallar. Devuelve solo un script tipo "eval" y es el del trailer de DISABLE YOUR ADBLOCK

Re: Fallan conectores, Powvideo y Flashx

Publicado: 26 Nov 2016, 12:13
por dentaku65
robalo escribió:Para el nuevo cambio en flashx y para que no se trague los 3 fakes y nos muestre el correcto se puede hacer algo parecido a lo siguiente:

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
Hi Robalo,
this code has been worked for a week, but today the 3 fake videos on flashx are back :-(
seems that ignores m in matches or not_fake.
Can you please show us a possible fixing way?

ciao
dentaku