Página 74 de 95

Re: Italian channels issues and development

Publicado: 04 Oct 2015, 16:06
por DrZ3r0
Grazie alla segnalazione di Cmos è risorto Openload (speriamo duri...).
Buona visione a tutti.

Re: Italian channels issues and development

Publicado: 04 Oct 2015, 16:35
por zanzibar1982
DrZ3r0 escribió:Grazie alla segnalazione di Cmos è risorto Openload (speriamo duri...).
Buona visione a tutti.
Quanto ho sperato in questo messaggio :lol:
Grazie Cmos & DrZ3r0!

Re: Italian channels issues and development

Publicado: 04 Oct 2015, 16:44
por Cmos
DrZ3r0 escribió:Grazie alla segnalazione di Cmos è risorto Openload (speriamo duri...).
Buona visione a tutti.
Wow, molte grazie DrZ3r0, un grande lavoro, e rapido! :D

Re: Italian channels issues and development

Publicado: 04 Oct 2015, 18:48
por orione7
Purtroppo con SOD e in Altadefinizione01 continua a non funzionare, almeno e' cosi' dall'estero :(

Re: Italian channels issues and development

Publicado: 04 Oct 2015, 20:29
por robalo
Buen trabajo DrZ3r0.

Realmente sólo necesitas 'AADecoder',prueba

Código: Seleccionar todo

# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector for openload.py
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------

import re

from core import scrapertools
from core import logger

headers = [
    ['User-Agent', 'Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Firefox/38.0'],
    ['Accept-Encoding', 'gzip, deflate'],
    ['Connection', 'keep-alive']
]

def test_video_exists(page_url):
    logger.info("[openload.py] test_video_exists(page_url='%s')" % page_url)

    data = scrapertools.cache_page(page_url, headers=headers)

    if 'We are sorry!' in data:
        return False, 'File Not Found or Removed.'

    return True, ""

def get_video_url(page_url, premium=False, user="", password="", video_password=""):
    logger.info("[openload.py] url=" + page_url)
    video_urls = []

    data = scrapertools.cache_page(page_url, headers=headers)

    ## pattern: https://github.com/LordVenom/venom-xbmc-addons/blob/master/plugin.video.vstream/resources/hosters/openload.py
    obf_char = re.sub(
        r'^\s+|\s+$',
        '',
        scrapertools.get_match(data,"<video(?:.|\s)*?<script\s[^>]*?>((?:.|\s)*?)<\/script")
    )
    ## extract url
    url = scrapertools.get_match(
        AADecoder(obf_char).decode().replace('\\',''),
        'src="([^"]+)"'

    video_urls.append([".mp4" + " [Openload]", url])

    return video_urls

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

    patronvideos = '//(?:www.)?openload.../(?:embed|f)/([0-9a-zA-Z-_]+)'
    logger.info("[openload.py] find_videos #" + patronvideos + "#")

    matches = re.compile(patronvideos, re.DOTALL).findall(text)

    for media_id in matches:
        titulo = "[Openload]"
        url = 'http://openload.co/f/%s' % media_id
        if url not in encontrados:
            logger.info("  url=" + url)
            devuelve.append([titulo, url, 'openload'])
            encontrados.add(url)
        else:
            logger.info("  url duplicada=" + url)

    return devuelve

##https://github.com/LordVenom/venom-xbmc-addons/blob/master/plugin.video.vstream/resources/lib/aadecode.py
class AADecoder(object):

    def __init__(self, aa_encoded_data):
        self.encoded_str = aa_encoded_data
        
        self.b = ["(c^_^o)", "(゚Θ゚)", "((o^_^o) - (゚Θ゚))", "(o^_^o)", 
            "(゚ー゚)", "((゚ー゚) + (゚Θ゚))", "((o^_^o) +(o^_^o))", "((゚ー゚) + (o^_^o))", 
            "((゚ー゚) + (゚ー゚))", "((゚ー゚) + (゚ー゚) + (゚Θ゚))", "(゚Д゚) .゚ω゚ノ", "(゚Д゚) .゚Θ゚ノ", 
            "(゚Д゚) ['c']", "(゚Д゚) .゚ー゚ノ", "(゚Д゚) .゚Д゚ノ", "(゚Д゚) [゚Θ゚]"]
        

    def is_aaencoded(self):
        idx = self.encoded_str.find("゚ω゚ノ= /`m´)ノ ~┻━┻   //*´∇`*/ ['_']; o=(゚ー゚)  =_=3; c=(゚Θ゚) =(゚ー゚)-(゚ー゚); ")
        if idx == -1:
            return False

        if self.encoded_str.find("(゚Д゚)[゚o゚]) (゚Θ゚)) ('_');", idx) == -1:
            return False

        return True;

    def base_repr(self, number, base=2, padding=0):
        digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
        if base > len(digits):
            base = len(digits)
        
        num = abs(number)
        res = []
        while num:
            res.append(digits[num % base])
            num //= base
        if padding:
            res.append('0' * padding)
        if number < 0:
            res.append('-')
        return ''.join(reversed(res or '0'))

    def decode_char(self, enc_char, radix):
        end_char = "+ "
        str_char = ""
        while enc_char != '':
            found = False
            for i in range(len(self.b)):
                if enc_char.find(self.b[i]) == 0:
                    str_char += self.base_repr(i, radix)
                    enc_char = enc_char[len(self.b[i]):]
                    found = True
                    break
                
            if found == False:
                result = re.search("\((.+?)\)\+ ", enc_char, re.DOTALL)
                if result == None:
                    return ""
                else:
                    enc_char = enc_char[len(result.group(1))+2:]
                    value = self.decode_digit(result.group(1), radix)
                    if value == "":
                        return ""
                    else:
                        str_char += value
            
            enc_char = enc_char[len(end_char):]
        
        return str_char
        
    def decode_digit(self, enc_int, radix):
        # mode 0=+, 1=-
        mode = 0
        value = 0
        
        while enc_int != '':
            found = False
            for i in range(len(self.b)):
                if enc_int.find(self.b[i]) == 0:
                    if mode == 0:
                        value += i
                    else:
                        value -= i
                    enc_int = enc_int[len(self.b[i]):]
                    found = True
                    break
                
            if found == False:
                return ""
            
            enc_int = re.sub('^\s+|\s+$', '', enc_int)
            if enc_int.find("+") == 0:
                mode = 0
            else:
                mode = 1
            
            enc_int = enc_int[1:]
            enc_int = re.sub('^\s+|\s+$', '', enc_int)
        
        return self.base_repr(value, radix)

    
    def decode(self):
        self.encoded_str = re.sub('^\s+|\s+$', '', self.encoded_str)

        # get data
        pattern = (r"\(゚Д゚\)\[゚o゚\]\+ (.+?)\(゚Д゚\)\[゚o゚\]\)")
        result = re.search(pattern, self.encoded_str, re.DOTALL)
        if result == None:
            print "AADecoder: data not found"
            return False

        data = result.group(1)

        # hex decode string
        begin_char = "(゚Д゚)[゚ε゚]+"
        alt_char = "(o゚ー゚o)+ "

        out = ''
        while data != '':
            # Check new char
            if data.find(begin_char) != 0:
                print "AADecoder: data not found"
                return False

            data = data[len(begin_char):]
            
            # Find encoded char
            enc_char = ""
            if data.find(begin_char) == -1:
                enc_char = data
                data = ""
            else:
                enc_char = data[:data.find(begin_char)]
                data = data[len(enc_char):]

            radix = 8
            # Detect radix 16 for utf8 char
            if enc_char.find(alt_char) == 0:
                enc_char = enc_char[len(alt_char):]
                radix = 16

            str_char = self.decode_char(enc_char, radix)
            if str_char == "":
                print "no match : " + data + "\nout = " + out + "\n"
                return False
            
            out += chr(int(str_char, radix))

        if out == "":
            print "no match : " + data
            return False

        return out

Re: Italian channels issues and development

Publicado: 04 Oct 2015, 20:34
por robalo
@orione7

Cambia la función 'findvid' por la que te pongo y añade la función 'play' que está a continuación de 'findvid' y a ver si te va mejor

Código: Seleccionar todo

def findvid(item):
    logger.info("[altadefinizione01.py] findvideos")
    itemlist = []

    ## Descarga la página
    data = re.sub(
        r'\t|\n|\r',
        '',
        anti_cloudflare(item.url)
    )
    '''
    <a href="http://www.vid.gg/video/1926a2839ef78" rel="nofollow" target="_blank"><li class="part"><span class="a"><i class="fa fa-circle-o fa-lg"></i> Streaming</span><span class="b"><img src="http://www.vidgg.to/images/favicon.ico" alt="Vidgg" height="10"> Vidgg</span><span class="d">360p</span><span class="c"><ul class="link_rating rating" data="8"><li><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li><li><i class="fa fa-star"></i></li></ul>
    '''
    patron = '<a href="([^"]+)"[^>]+><li class="part">'  # url
    patron += '<span class="a"><i[^>]+></i>([^<]+)</span>'  # type
    patron += '<span class="b"><img src="([^"]+)"[^>]+>([^<]+)</span>'  # thumbnail & title
    patron += '<span class="d">([^<]+)</span>'  # quality
    patron += '<span class="c"><ul class="link_rating rating" data="([^"]+)">'  # rating

    matches = re.compile(patron, re.DOTALL).findall(data)

    for url, type, thumbnail, scrapedtitle, quality, rating in matches:
        title = "[" + scrapedtitle.strip() + "] " + type + " (" + quality.strip() + ") (" + rating + ")"

        itemlist.append(
            Item(channel=__channel__,
                 action="play",
                 title=title, url=url,
                 thumbnail=thumbnail,
                 fulltitle=item.fulltitle,
                 show=item.show,
                 plot=item.plot))

    return itemlist

def play(item):
    logger.info("[altadefinizione01.py] play")

    from servers import servertools
    itemlist = servertools.find_video_items(data=item.url)

    for videoitem in itemlist:
        videoitem.title = item.show
        videoitem.fulltitle = item.fulltitle
        videoitem.show = item.show
        videoitem.thumbnail = item.thumbnail
        videoitem.channel = __channel__

    return itemlist

Re: Italian channels issues and development

Publicado: 04 Oct 2015, 22:08
por orione7
@Robalo you are a Genius, Openload now working and Videomega also with the Mod we did :)
Thank you

Re: Italian channels issues and development

Publicado: 04 Oct 2015, 22:20
por orione7
L'unico proplema che al prossimo update di pelis viene modificato di nuovo. Spero che le modifiche di Robalo possano diventare permanenti nei rispettivi di Zanzibar, Fenice e Dentaku

Re: Italian channels issues and development

Publicado: 05 Oct 2015, 05:59
por dentaku65
orione7 escribió:L'unico proplema che al prossimo update di pelis viene modificato di nuovo. Spero che le modifiche di Robalo possano diventare permanenti nei rispettivi di Zanzibar, Fenice e Dentaku
orione, metti dei link con i file zippati alle modifiche che hai fatto... ci do' un'occhio questa sera

Re: Italian channels issues and development

Publicado: 05 Oct 2015, 08:47
por robalo
En mi post de openload.py hay un pequeño bug en el copy/paste consecuencia de la eliminación de las líneas 'print "###...'.

En la parte

Código: Seleccionar todo

    ## extract url
    url = scrapertools.get_match(
        AADecoder(obf_char).decode().replace('\\',''),
        'src="([^"]+)"'
Le falta el útimo paréntisis ')'

Código: Seleccionar todo

    ## extract url
    url = scrapertools.get_match(
        AADecoder(obf_char).decode().replace('\\',''),
        'src="([^"]+)"'
    )
Lo siento :oops: