Página 37 de 44

Re: Reportar aquí cualquier problema con Openload

Publicado: 22 Abr 2017, 15:48
por Maikelnai
Buenas, a vosotros os funciona?

Re: Reportar aquí cualquier problema con Openload

Publicado: 22 Abr 2017, 16:05
por bic
Maikelnai escribió:
22 Abr 2017, 15:48
Buenas, a vosotros os funciona?
No a mi en estos momentos tampoco me funciona ahora falta saber si sera un fallo puntual y funcionara mas tarde o si habran hecho cambios otra vez :? ..........La verdad es que estoy un poco sorprendido de que los ultimos arreglos recientes duren tanto y no haya que repararlo a diario............En fin ojala siga durando tanto sin dar la lata openload con sus cambios :)

Re: Reportar aquí cualquier problema con Openload

Publicado: 22 Abr 2017, 22:35
por Cmos
Corregido ;)

Re: Reportar aquí cualquier problema con Openload

Publicado: 22 Abr 2017, 23:07
por bic
Gracias como siempre :)

Re: Reportar aquí cualquier problema con Openload

Publicado: 23 Abr 2017, 20:28
por Masay90
gracias por el arreglo

Re: Reportar aquí cualquier problema con Openload

Publicado: 24 Abr 2017, 08:18
por haigor
Muchas gracias

Re: Reportar aquí cualquier problema con Openload

Publicado: 02 May 2017, 16:25
por qqplayer
Hola cmos , como siempre lo primero darte las gracias por el curro , funciona perfecto.
Seria posible si no es mucho pedir que lo "adaptaras" al plugin url resolver para poder usar openload en otros addons?

Este el codigo de openload.py en urlresolver:

Código: Seleccionar todo

# -*- coding: utf-8 -*-
"""
openload.io urlresolver plugin
Copyright (C) 2015 tknorris

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import os
import json
import ol_gmu
from urlresolver import common
from urlresolver.common import i18n
from urlresolver.resolver import UrlResolver, ResolverError

API_BASE_URL = 'https://api.openload.co/1'
INFO_URL = API_BASE_URL + '/streaming/info'
GET_URL = API_BASE_URL + '/streaming/get?file={media_id}'
FILE_URL = API_BASE_URL + '/file/info?file={media_id}'
OL_PATH = os.path.join(common.plugins_path, 'ol_gmu.py')

class OpenLoadResolver(UrlResolver):
    name = "openload"
    domains = ["openload.io", "openload.co", "oload.tv"]
    pattern = '(?://|\.)(o(?:pen)??load\.(?:io|co|tv))/(?:embed|f)/([0-9a-zA-Z-_]+)'

    def __init__(self):
        self.net = common.Net()

    def get_media_url(self, host, media_id):
        try:
            self._auto_update(self.get_setting('url'), OL_PATH, self.get_setting('key'))
            reload(ol_gmu)
            return ol_gmu.get_media_url(self.get_url(host, media_id))  # @UndefinedVariable
        except Exception as e:
            common.log_utils.log_debug('Exception during openload resolve parse: %s' % (e))
            try:
                if not self.__file_exists(media_id):
                    raise ResolverError('File Not Available')
                
                video_url = self.__check_auth(media_id)
                if not video_url:
                    video_url = self.__auth_ip(media_id)
            except ResolverError:
                raise
            
            if video_url:
                return video_url
            else:
                raise ResolverError(i18n('no_ol_auth'))

    def get_url(self, host, media_id):
        return 'http://openload.co/embed/%s' % (media_id)

    def __file_exists(self, media_id):
        js_data = self.__get_json(FILE_URL.format(media_id=media_id))
        return js_data.get('result', {}).get(media_id, {}).get('status') == 200
        
    def __auth_ip(self, media_id):
        js_data = self.__get_json(INFO_URL)
        pair_url = js_data.get('result', {}).get('auth_url', '')
        if pair_url:
            pair_url = pair_url.replace('\/', '/')
            header = i18n('ol_auth_header')
            line1 = i18n('auth_required')
            line2 = i18n('visit_link')
            line3 = i18n('click_pair') % (pair_url)
            with common.kodi.CountdownDialog(header, line1, line2, line3) as cd:
                return cd.start(self.__check_auth, [media_id])
        
    def __check_auth(self, media_id):
        try:
            js_data = self.__get_json(GET_URL.format(media_id=media_id))
        except ResolverError as e:
            status, msg = e
            if status == 403:
                return
            else:
                raise ResolverError(msg)
        
        return js_data.get('result', {}).get('url')
    
    def __get_json(self, url):
        result = self.net.http_GET(url).content
        common.log_utils.log(result)
        js_result = json.loads(result)
        if js_result['status'] != 200:
            raise ResolverError(js_result['status'], js_result['msg'])
        return js_result

    @classmethod
    def get_settings_xml(cls):
        xml = super(cls, cls).get_settings_xml()
        xml.append('<setting id="%s_auto_update" type="bool" label="%s" default="true"/>' % (cls.__name__, i18n('auto_update')))
        xml.append('<setting id="%s_url" type="text" label="    %s" default="" visible="eq(-1,true)"/>' % (cls.__name__, i18n('update_url')))
        xml.append('<setting id="%s_key" type="text" label="    %s" default="" option="hidden" visible="eq(-2,true)"/>' % (cls.__name__, i18n('decrypt_key')))
        xml.append('<setting id="%s_etag" type="text" default="" visible="false"/>' % (cls.__name__))
        return xml
Si no es posible por el motivo que sea gracias de nuevo por adaptarlo para pelisalacarta.
Un saludo.

Re: Reportar aquí cualquier problema con Openload

Publicado: 04 May 2017, 18:39
por Cmos
qqplayer escribió:
02 May 2017, 16:25
Hola cmos , como siempre lo primero darte las gracias por el curro , funciona perfecto.
Seria posible si no es mucho pedir que lo "adaptaras" al plugin url resolver para poder usar openload en otros addons?
Buenas qqplayer, la verdad es que no es complicado adaptarlo para urlresolver, el problema sería más que nada mantenerlo actualizado, porque lógicamente tarde o temprano openload cambiará, e igualmente el plugin urlresolver también puede tener cambios internos. De todas formas, te dejo aquí el código, pero no me puedo comprometer a actualizarlo cada vez que cambie...

Código: Seleccionar todo

# -*- coding: utf-8 -*-
"""
openload.io urlresolver plugin
Copyright (C) 2015 tknorris

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
import re
import os
import json
import ol_gmu
from urlresolver import common
from urlresolver.common import i18n
from urlresolver.resolver import UrlResolver, ResolverError

API_BASE_URL = 'https://api.openload.co/1'
INFO_URL = API_BASE_URL + '/streaming/info'
GET_URL = API_BASE_URL + '/streaming/get?file={media_id}'
FILE_URL = API_BASE_URL + '/file/info?file={media_id}'
OL_PATH = os.path.join(common.plugins_path, 'ol_gmu.py')
default_headers = dict()
default_headers["User-Agent"] = "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0"
default_headers["Accept"] = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
default_headers["Accept-Language"] = "es-ES,es;q=0.8,en-US;q=0.5,en;q=0.3"
default_headers["Accept-Charset"] = "UTF-8"
default_headers["Accept-Encoding"] = "gzip"

class OpenLoadResolver(UrlResolver):
    name = "openload"
    domains = ["openload.io", "openload.co", "oload.tv"]
    pattern = '(?://|\.)(o(?:pen)??load\.(?:io|co|tv))/(?:embed|f)/([0-9a-zA-Z-_]+)'

    def __init__(self):
        self.net = common.Net()

    def get_media_url(self, host, media_id):
        try:
            url = self.get_url(host, media_id)
            import urllib2, gzip
            from StringIO import StringIO
            handlers = [urllib2.HTTPHandler(debuglevel=False)]
            opener = urllib2.build_opener(*handlers)
            req = urllib2.Request(url, '', default_headers)
            data = opener.open(req).read()
            data = gzip.GzipFile(fileobj=StringIO(data)).read()

            text_encode = re.findall('(゚ω゚.*?\(\'\_\'\));', data, re.DOTALL)
            text_decode = ""
            for t in text_encode:
                text_decode += self.decode(t)

            var_r = re.findall("window\.[A-z]+\s*=\s*['\"]([^'\"]+)['\"]", text_decode, re.DOTALL)[0]
            var_encodes = re.findall('id="%s[^"]*">([^<]+)<' % var_r, data, re.DOTALL)
            numeros = re.findall('_[A-Fa-f0-9]+x[A-Fa-f0-9]+\s*=\s*([0-9]{4,}|0x[A-Fa-f0-9]{4,});', data, re.DOTALL)
            op1, op2 = re.findall('\(0x(\d),0x(\d)\);', data, re.DOTALL)[0]

            videourl = ""
            for encode in var_encodes:
                text_decode = ""
                try:
                    mult = int(op1) * int(op2)
                    rango1 = encode[:mult]
                    decode1 = []
                    for i in range(0, len(rango1), 8):
                        decode1.append(int(rango1[i:i+8], 16))
                    rango1 = encode[mult:]
                    j = 0
                    i = 0
                    while i < len(rango1):
                        index1 = 64
                        value1 = 0
                        value2 = 0
                        value3 = 0
                        while True:
                            if (i + 1) >= len(rango1):
                                index1 = 143
                            value3 = int(rango1[i:i+2], 16)
                            i += 2
                            data = value3 & 63
                            value2 += data << value1
                            value1 += 6
                            if value3 < index1:
                                break

                        value4 = value2 ^ decode1[j % (mult/8)]
                        for n in numeros:
                            if not n.isdigit():
                                n = int(n, 16)
                            value4 ^= int(n)
                        value5 = index1 * 2 + 127 
                        for h in range(4):
                            valorfinal = (value4 >> 8 * h) & (value5)
                            valorfinal = chr(valorfinal)
                            if valorfinal != "%":
                                text_decode += valorfinal
                        j += 1

                except:
                    continue

                videourl = "https://openload.co/stream/%s?mime=true" % text_decode
            if videourl:
                return videourl
            else:
                raise ResolverError('Error al descodificar')
        except Exception as e:
            common.log_utils.log_debug('Exception during openload resolve parse: %s' % (e))
            try:
                if not self.__file_exists(media_id):
                    raise ResolverError('File Not Available')
            except ResolverError:
                raise


    def get_url(self, host, media_id):
        return 'http://openload.co/embed/%s' % (media_id)

    def __file_exists(self, media_id):
        js_data = self.__get_json(FILE_URL.format(media_id=media_id))
        return js_data.get('result', {}).get(media_id, {}).get('status') == 200
    
    def __get_json(self, url):
        result = self.net.http_GET(url).content
        common.log_utils.log(result)
        js_result = json.loads(result)
        if js_result['status'] != 200:
            raise ResolverError(js_result['status'], js_result['msg'])
        return js_result

    @classmethod
    def get_settings_xml(cls):
        xml = super(cls, cls).get_settings_xml()
        xml.append('<setting id="%s_auto_update" type="bool" label="%s" default="true"/>' % (cls.__name__, i18n('auto_update')))
        xml.append('<setting id="%s_url" type="text" label="    %s" default="" visible="eq(-1,true)"/>' % (cls.__name__, i18n('update_url')))
        xml.append('<setting id="%s_key" type="text" label="    %s" default="" option="hidden" visible="eq(-2,true)"/>' % (cls.__name__, i18n('decrypt_key')))
        xml.append('<setting id="%s_etag" type="text" default="" visible="false"/>' % (cls.__name__))
        return xml

    def decode(self, text):
        text = re.sub(r"\s+|/\*.*?\*/", "", text)
        data = text.split("+(゚Д゚)[゚o゚]")[1]
        chars = data.split("+(゚Д゚)[゚ε゚]+")[1:]

        txt = ""
        for char in chars:
            char = char \
                .replace("(o゚ー゚o)","u") \
                .replace("c", "0") \
                .replace("(゚Д゚)['0']", "c") \
                .replace("゚Θ゚", "1") \
                .replace("!+[]", "1") \
                .replace("-~", "1+") \
                .replace("o", "3") \
                .replace("_", "3") \
                .replace("゚ー゚", "4") \
                .replace("(+", "(")
            char = re.sub(r'\((\d)\)', r'\1', char)

            c = ""; subchar = ""
            for v in char:
                c+= v
                try: x = c; subchar+= str(eval(x)); c = ""
                except: pass
            if subchar != '': txt+= subchar + "|"
        txt = txt[:-1].replace('+','')

        txt_result = "".join([ chr(int(n, 8)) for n in txt.split('|') ])

        return self.toStringCases(txt_result)

    def toStringCases(self, txt_result):
        sum_base = ""
        m3 = False
        if ".toString(" in txt_result:
            if "+(" in  txt_result:
                m3 = True
                sum_base = "+"+re.findall(".toString...(\d+).", txt_result, re.DOTALL)[0]
                txt_pre_temp = re.findall("..(\d),(\d+).", txt_result, re.DOTALL)
                txt_temp = [ (n, b) for b ,n in txt_pre_temp ]
            else:
                txt_temp = re.findall('(\d+)\.0.\w+.([^\)]+).', txt_result, re.DOTALL)
            for numero, base in txt_temp:
                code = self.toString( int(numero), eval(base+sum_base) )
                if m3:
                    txt_result = re.sub( r'"|\+', '', txt_result.replace("("+base+","+numero+")", code) )
                else:
                    txt_result = re.sub( r"'|\+", '', txt_result.replace(numero+".0.toString("+base+")", code) )
        return txt_result

    def toString(self, number,base):
        string = "0123456789abcdefghijklmnopqrstuvwxyz"
        if number < base:
            return string[number]
        else:
            return toString(number//base,base) + string[number%base]

Re: Reportar aquí cualquier problema con Openload

Publicado: 07 May 2017, 14:19
por qqplayer
Cmos , muchisimas gracias , va perfecto.
Que pena que no se pueda hacer un corta-pega con el de pelisalacarta.
Muchos addons usan el urlresolver y con lo poco que tarda openload en cambiar supongo que en unos dias me quedo sin el , habra que aprovechar.
Un saludo.

Re: Reportar aquí cualquier problema con Openload

Publicado: 12 May 2017, 00:32
por Maikelnai
Buenas. Diría que ya no funciona :shock: