Example #1
0
def getStreams(url):

    try:
        from resources.lib import cache

        past = 'U2FsdGVkX19RORocDuzsf3mC//zvGb1w/UUkHUrCD84DXjJhUL0uFz2Z0liO8m7SYfVZMy8YsWNw1WeRDpTTMvIB6bqwAr1jownf6virclY='
        # xbmc.log('PAST IS: %s' % past, level=xbmc.LOGNOTICE)
        pastes = cache.get(getUrl, 3, jscrypto.decode(past, base64.b64decode('b25seSBidWdhdHNpbmhv')))
        # xbmc.log('PASTES IS: %s' % pastes, level=xbmc.LOGNOTICE)
        ret = xor2(base64.b64decode(pastes), 'sly6B89wqxt2N')
        ret = json.loads(ret)
        info, key = ret['i7'], ret['k7']
    except BaseException:
        raise Exception()
    xbmc.log('RET IS: %s' % str(ret), level=xbmc.LOGNOTICE)

    myurl = url
    content = getUrl(myurl)
    sources = re.findall(r'''onClick=['"]\w+\(\'(\w+)\'''', content, re.DOTALL)
    out = []

    for i, s in enumerate(set(sources)):
        data = aes.AESModeOfOperationCBC(key, info).decrypt(s.replace(' ', '').decode('hex'))
        s = re.findall('([a-f0-9]+)', data)[0].decode('hex')
        title = 'Link {}'.format(i + 1)
        out.append({"title": title, "tvid": title, "url": '{}@{}@{}'.format(s, info, key), "refurl": url})
    # xbmc.log('HTMLSTREAMS-OUT: %s' % str(out), level=xbmc.LOGNOTICE)
    return out
Example #2
0
    def get_video(self, url):
        html = requests.get(url, headers=self.hdr).text

        try:
            ct = re.findall('hlsplayurl = .{"ct":"(.*?)"', html)[0]
            salt = re.findall('hlsplayurl = .{.*?"s":"(.*?)"', html)[0]
            passphrase = re.findall('var dailytoday = "(.*?)"', html)[0]
            salt = salt.decode('hex')
            val = eval(jscrypto.decode(ct, passphrase, salt))
            stream_url = val.replace('\\', '')
            if 'webisode' in stream_url:
                strurl, token = stream_url.split('?')
                strurl = strurl.replace('/Webisode', '')
                url2 = strurl.split('Webisode')[0]
                epno = re.findall('episode-(.*?)-', url)[0]
                stream_url = '%sEpisode_%s.smil/master.m3u8?%s' % (url2, epno,
                                                                   token)
        except:
            stream_url = None

        return stream_url
Example #3
0
def getStreams(url):
    try:
        from resources.lib import cache

        past = 'U2FsdGVkX19q9T+lFjzxG4a0je4b6tI1Uc3HUVnoWBiD/Vw59IpxZ+cJuwDsjszZPsVkradgfXb0sxZVxY2J1h96IuNIpyAHyNS1vUKYpcU='
        # xbmc.log('PAST IS: %s' % past, level=xbmc.LOGNOTICE)
        pastes = cache.get(
            getUrl, 3,
            jscrypto.decode(
                past, base64.b64decode('SXMgT25seSBPbmUgQnVnYXRzaW5obw==')))
        # xbmc.log('PASTES IS: %s' % pastes, level=xbmc.LOGNOTICE)
        ret = xor2(base64.b64decode(pastes), 'sly6B89wqxt2N')
        ret = json.loads(ret)
        info, key = ret['i7'], ret['k7']
    except BaseException:
        raise Exception()
    xbmc.log('RET IS: %s' % str(ret), level=xbmc.LOGNOTICE)

    myurl = url
    content = getUrl(myurl)
    sources = re.findall(r'''onClick=['"]\w+\(\'(\w+)\'''', content, re.DOTALL)
    out = []

    for i, s in enumerate(set(sources)):
        decrypter = pyAES.Decrypter(pyAES.AESModeOfOperationECB(key))
        data = decrypter.feed(s.strip().decode('hex'))
        data += decrypter.feed()
        s = data.decode('hex')
        title = 'Link {}'.format(i + 1)
        out.append({
            "title": title,
            "tvid": title,
            "url": '{}@{}@{}'.format(s, info, key),
            "refurl": url
        })
    # xbmc.log('HTMLSTREAMS-OUT: %s' % str(out), level=xbmc.LOGNOTICE)
    return out