def DecryptKeeplinks(sUrl):
    oRequestHandler = cRequestHandler(sUrl)
    sHtmlContent = oRequestHandler.request()
    Cookie = oRequestHandler.GetCookies()

    key = re.search('<div class="g-recaptcha" data-sitekey="(.+?)"></div>', str(sHtmlContent)).group(1)
    hiddenAction = re.search('<input type="hidden" name=".+?" id="hiddenaction" value="([^"]+)"/>', str(sHtmlContent)).group(1)

    gToken = ResolveCaptcha(key, sUrl)

    data = "myhiddenpwd=&hiddenaction="+hiddenAction+"+&captchatype=Re&hiddencaptcha=1&hiddenpwd=&g-recaptcha-response="+gToken
    oRequestHandler = cRequestHandler(sUrl)
    oRequestHandler.setRequestType(1)
    oRequestHandler.addHeaderEntry('User-Agent', UA)
    oRequestHandler.addHeaderEntry('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('Accept-Language', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('Accept-Encoding', 'gzip, deflate')
    oRequestHandler.addHeaderEntry('Referer', sUrl)
    oRequestHandler.addHeaderEntry('Content-Type', 'application/x-www-form-urlencoded')
    oRequestHandler.addHeaderEntry('Content-Length', len(str(data)))
    oRequestHandler.addHeaderEntry('Cookie', 'flag['+sUrl.split('/')[4]+']=1;')
    oRequestHandler.addParametersLine(data)
    sHtmlContent = oRequestHandler.request()

    sUrl = re.search('class="selecttext live">([^<]+)</a>', str(sHtmlContent)).group(1)
    return sUrl
Esempio n. 2
0
def DecryptOuo(sUrl):
    urlOuo = sUrl
    if not '/fbc/' in urlOuo:
        urlOuo = urlOuo.replace('io/', 'io/fbc/').replace('press/', 'press/fbc/')

    oRequestHandler = cRequestHandler(urlOuo)
    sHtmlContent = oRequestHandler.request()
    Cookie = oRequestHandler.GetCookies()

    key = re.search('sitekey: "(.+?)"', str(sHtmlContent)).group(1)
    OuoToken = re.search('<input name="_token" type="hidden" value="(.+?)">.+?<input id="v-token" name="v-token" type="hidden" value="(.+?)"', str(sHtmlContent), re.MULTILINE|re.DOTALL)

    gToken = ResolveCaptcha(key, urlOuo)

    url = urlOuo.replace('/fbc/', '/go/')
    params = '_token=' + OuoToken.group(1) + '&g-recaptcha-response=' + gToken + "&v-token=" + OuoToken.group(2)

    oRequestHandler = cRequestHandler(url)
    oRequestHandler.setRequestType(1)
    oRequestHandler.addHeaderEntry('User-Agent', UA)
    oRequestHandler.addHeaderEntry('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('Accept-Language', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('Accept-Encoding', 'gzip, deflate')
    oRequestHandler.addHeaderEntry('Referer', urlOuo)
    oRequestHandler.addHeaderEntry('Content-Type', 'application/x-www-form-urlencoded')
    oRequestHandler.addHeaderEntry('Content-Length', str(len(params)))
    oRequestHandler.addHeaderEntry('Cookie', Cookie)
    oRequestHandler.addParametersLine(params)
    sHtmlContent = oRequestHandler.request()

    final = re.search('<form method="POST" action="(.+?)" accept-charset=.+?<input name="_token" type="hidden" value="(.+?)">', str(sHtmlContent))

    url = final.group(1)
    params = '_token=' + final.group(2) + '&x-token=' + ""

    oRequestHandler = cRequestHandler(url)
    oRequestHandler.setRequestType(1)
    oRequestHandler.addHeaderEntry('User-Agent', UA)
    oRequestHandler.addHeaderEntry('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('Accept-Language', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('Accept-Encoding', 'gzip, deflate')
    oRequestHandler.addHeaderEntry('Referer', urlOuo)
    oRequestHandler.addHeaderEntry('Content-Type', 'application/x-www-form-urlencoded')
    oRequestHandler.addHeaderEntry('Content-Length', str(len(params)))
    oRequestHandler.addHeaderEntry('Cookie', Cookie)
    oRequestHandler.addParametersLine(params)
    sHtmlContent = oRequestHandler.request()

    return oRequestHandler.getRealUrl()
def DecryptOuo(sUrl):
    urlOuo = sUrl
    if not '/fbc/' in urlOuo:
        urlOuo = urlOuo.replace('io/',
                                'io/fbc/').replace('press/', 'press/fbc/')

    oRequestHandler = cRequestHandler(urlOuo)
    sHtmlContent = oRequestHandler.request()
    Cookie = oRequestHandler.GetCookies()

    key = re.search('sitekey: "(.+?)"', str(sHtmlContent)).group(1)
    OuoToken = re.search('<input name="_token" type="hidden" value="(.+?)">',
                         str(sHtmlContent)).group(1)

    gToken = ResolveCaptcha(key, urlOuo)

    url = urlOuo.replace('/fbc/', '/go/')
    params = '_token=' + OuoToken + '&g-recaptcha-response=' + gToken
    headers = {
        'User-Agent': UA,
        'Accept':
        'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
        'Accept-Language':
        'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
        'Accept-Encoding': 'gzip, deflate',
        'Referer': urlOuo,
        'Content-Type': 'application/x-www-form-urlencoded',
        'Content-Length': str(len(params)),
        'Cookie': Cookie
    }

    r = requests.post(url, data=params, headers=headers)

    final = re.search(
        '<form method="POST" action="(.+?)" accept-charset="UTF-8"><input name="_token" type="hidden" value="(.+?)">',
        str(r.text))
    r = requests.post(final.group(1),
                      data='_token=' + final.group(2),
                      headers=headers)
    return r.url
Esempio n. 4
0
    def __getMediaLinkForGuest(self):

        api_call = ''

        ids = self.__getIdFromUrl()

        self.__sUrl = 'http://hqq.tv/player/embed_player.php?vid=' + ids + '&autoplay=no'

        player_url = self.__sUrl

        headers = {
            'User-Agent':
            UA,
            #'Host': 'hqq.tv',
            'Referer':
            'http://hqq.tv/',
            'Accept':
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
            #'Accept-Encoding': 'gzip, deflate, br',
            #'Content-Type': 'text/html; charset=utf-8'
        }

        oRequestHandler = cRequestHandler(player_url)
        oRequestHandler.addHeaderEntry('User-Agent', UA)
        oRequestHandler.addHeaderEntry(
            'Accept',
            'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
        oRequestHandler.addHeaderEntry('Referer', 'http://hqq.tv/')
        html = oRequestHandler.request()

        Host = 'https://' + self.GetHost(player_url) + '/'

        data = ''
        data = DecodeAllThePage(html)

        #data = ''
        #code_crypt = re.search('(;eval\(function\(w,i,s,e\){.+?\)\);)\s*<', html, re.DOTALL)
        #if code_crypt:
        #    data = unwise.unwise_process(code_crypt.group(1))
        #else:
        #    VSlog('prb1')

        if data:
            http_referer = ''
            _pass = ''

            iss = GetIp()
            vid = re.search("videokeyorig=\'(.+?)\'", data, re.DOTALL).group(1)
            at = re.search("attoken=\'(.+?)\'", data, re.DOTALL).group(1)
            r = re.search('var referer = "([^"]+)"', data, re.DOTALL)
            if r:
                http_referer = r.group(1)

            import string, random
            _BOUNDARY_CHARS = string.digits
            boundary = ''.join(
                random.choice(_BOUNDARY_CHARS) for i in range(17))

            url2 = "https://hqq.tv/sec/player/embed_player_" + boundary + ".php?iss=" + iss + "=&vid=" + vid + "&at=" + at + "&autoplayed=yes&referer=on&http_referer=" + http_referer + "&pass=&embed_from=&need_captcha=0&secure=0&g-recaptcha-response="
            oRequestHandler = cRequestHandler(url2)
            oRequestHandler.addHeaderEntry('User-Agent', UA)
            oRequestHandler.addHeaderEntry(
                'Accept',
                'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
            )
            oRequestHandler.addHeaderEntry('Referer', 'http://hqq.tv/')
            sHtmlContent = oRequestHandler.request()

            key = re.search("\'sitekey\' : \'(.+?)\'",
                            str(sHtmlContent)).group(1)
            gToken = ResolveCaptcha(key, self.__sUrl)

            url2 = url2 + gToken

            oRequestHandler = cRequestHandler(url2)
            oRequestHandler.addHeaderEntry('User-Agent', UA)
            oRequestHandler.addHeaderEntry(
                'Accept',
                'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'
            )
            oRequestHandler.addHeaderEntry('Referer', 'http://hqq.tv/')
            data = oRequestHandler.request()

            data = urllib.unquote(data)

            data = DecodeAllThePage(data)
            #VSlog(data)

            at = re.search(r'var\s*at\s*=\s*"([^"]*?)"', data).group(1)

        nameVar = re.search(
            'true.+?\s*.+?link_1="\+encodeURIComponent\((.+?)\)\+"&server_2="\+encodeURIComponent\((.+?)\)\+"&vid="\+encodeURIComponent\("(.+?)"\)',
            data)
        var1 = re.search('var ' + nameVar.group(1) + ' = "(.+?)"',
                         data).group(1)
        var2 = re.search('var ' + nameVar.group(2) + ' = "(.+?)"',
                         data).group(1)

        #bricolage
        api_call = "https://hqq.tv/player/get_md5.php?ver=2&at=" + urllib.quote(
            at, safe='~()*!.\'') + "&adb=" + urllib.quote(
                "1/", safe='~()*!.\'') + "&b=1&link_1=" + urllib.quote(
                    var1, safe='~()*!.\'') + "&server_2=" + urllib.quote(
                        var2, safe='~()*!.\'') + "&vid=" + urllib.quote(
                            nameVar.group(3),
                            safe='~()*!.\'') + "&ext=.mp4.m3u8"

        #use a fake headers
        Header = "Accept-Language= fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3&Accept-Encoding= gzip, deflate, br"
        api_call = api_call + '|' + Header

        if not (api_call == False):
            return True, api_call

        return False, False
Esempio n. 5
0
def DecryptOuo():
    from resources.lib.recaptcha import ResolveCaptcha
    oGui = cGui()
    oInputParameterHandler = cInputParameterHandler()
    urlOuo = oInputParameterHandler.getValue('siteUrl')
    sMovieTitle = oInputParameterHandler.getValue('sMovieTitle')
    sThumb = oInputParameterHandler.getValue('sThumb')

    if '/fbc/' not in urlOuo:
        urlOuo = urlOuo.replace('io/', 'io/fbc/').replace('press/', 'press/fbc/')

    oRequestHandler = cRequestHandler(urlOuo)
    sHtmlContent = oRequestHandler.request()
    Cookie = oRequestHandler.GetCookies()

    key = re.search('sitekey: "([^"]+)', str(sHtmlContent)).group(1)
    OuoToken = re.search('<input name="_token" type="hidden" value="([^"]+).+?id="v-token" name="v-token" type="hidden" value="([^"]+)', str(sHtmlContent), re.MULTILINE | re.DOTALL)

    gToken = ResolveCaptcha(key, urlOuo)

    url = urlOuo.replace('/fbc/', '/go/')
    params = '_token=' + OuoToken.group(1) + '&g-recaptcha-response=' + gToken + '&v-token=' + OuoToken.group(2)

    oRequestHandler = cRequestHandler(url)
    oRequestHandler.setRequestType(1)
    oRequestHandler.addHeaderEntry('User-Agent', UA)
    oRequestHandler.addHeaderEntry('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('Accept-Language', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('Accept-Encoding', 'gzip, deflate')
    oRequestHandler.addHeaderEntry('Referer', urlOuo)
    oRequestHandler.addHeaderEntry('Content-Type', 'application/x-www-form-urlencoded')
    oRequestHandler.addHeaderEntry('Content-Length', str(len(params)))
    oRequestHandler.addHeaderEntry('Cookie', Cookie)
    oRequestHandler.addParametersLine(params)
    sHtmlContent = oRequestHandler.request()

    final = re.search('<form method="POST" action="(.+?)" accept-charset=.+?<input name="_token" type="hidden" value="(.+?)">', str(sHtmlContent))

    url = final.group(1)
    params = '_token=' + final.group(2) + '&x-token=' + ''

    oRequestHandler = cRequestHandler(url)
    oRequestHandler.setRequestType(1)
    oRequestHandler.addHeaderEntry('User-Agent', UA)
    oRequestHandler.addHeaderEntry('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('Accept-Language', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
    oRequestHandler.addHeaderEntry('Accept-Encoding', 'gzip, deflate')
    oRequestHandler.addHeaderEntry('Referer', urlOuo)
    oRequestHandler.addHeaderEntry('Content-Type', 'application/x-www-form-urlencoded')
    oRequestHandler.addHeaderEntry('Content-Length', str(len(params)))
    oRequestHandler.addHeaderEntry('Cookie', Cookie)
    oRequestHandler.addParametersLine(params)
    # sHtmlContent = oRequestHandler.request()

    sHosterUrl = oRequestHandler.getRealUrl()
    oHoster = cHosterGui().checkHoster(sHosterUrl)
    if (oHoster != False):
        oHoster.setDisplayName(sMovieTitle)
        oHoster.setFileName(sMovieTitle)
        cHosterGui().showHoster(oGui, oHoster, sHosterUrl, sThumb)

    oGui.setEndOfDirectory()
Esempio n. 6
0
    def __getMediaLinkForGuest(self):

        api_call = ''

        ids = self.__getIdFromUrl()

        self.__sUrl = 'http://hqq.tv/player/embed_player.php?vid=' + ids + '&autoplay=no'

        player_url = self.__sUrl

        headers = {'User-Agent': UA ,
                   #'Host': 'hqq.tv',
                   'Referer': 'http://hqq.tv/',
                   'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
                   #'Accept-Encoding': 'gzip, deflate, br',
                   #'Content-Type': 'text/html; charset=utf-8'
                   }

        oRequestHandler = cRequestHandler(player_url)
        oRequestHandler.addHeaderEntry('User-Agent',UA)
        oRequestHandler.addHeaderEntry('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
        oRequestHandler.addHeaderEntry('Referer', 'http://hqq.tv/')
        html = oRequestHandler.request()

        Host = 'https://' + self.GetHost(player_url) + '/'

        data = ''
        data = DecodeAllThePage(html)

        #data = ''
        #code_crypt = re.search('(;eval\(function\(w,i,s,e\){.+?\)\);)\s*<', html, re.DOTALL)
        #if code_crypt:
        #    data = unwise.unwise_process(code_crypt.group(1))
        #else:
        #    VSlog('prb1')

        if data:
            http_referer = ''
            _pass = ''

            iss = GetIp()
            vid = re.search("videokeyorig=\'(.+?)\'", data, re.DOTALL).group(1)
            at = re.search("attoken=\'(.+?)\'", data, re.DOTALL).group(1)
            r = re.search('var referer = "([^"]+)"', data, re.DOTALL)
            if r:
                http_referer = r.group(1)

            import string, random
            _BOUNDARY_CHARS = string.digits
            boundary = ''.join(random.choice(_BOUNDARY_CHARS) for i in range(17))

            url2 = "https://hqq.tv/sec/player/embed_player_"+boundary+".php?iss="+iss+"=&vid="+vid+"&at="+at+"&autoplayed=yes&referer=on&http_referer="+http_referer+"&pass=&embed_from=&need_captcha=0&secure=0&g-recaptcha-response="
            oRequestHandler = cRequestHandler(url2)
            oRequestHandler.addHeaderEntry('User-Agent',UA)
            oRequestHandler.addHeaderEntry('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
            oRequestHandler.addHeaderEntry('Referer', 'http://hqq.tv/')
            sHtmlContent = oRequestHandler.request()

            key = re.search("\'sitekey\' : \'(.+?)\'",str(sHtmlContent)).group(1)
            gToken = ResolveCaptcha(key,self.__sUrl)

            url2 = url2 + gToken

            oRequestHandler = cRequestHandler(url2)
            oRequestHandler.addHeaderEntry('User-Agent',UA)
            oRequestHandler.addHeaderEntry('Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8')
            oRequestHandler.addHeaderEntry('Referer', 'http://hqq.tv/')
            data = oRequestHandler.request()

            data = urllib.unquote(data)

            data = DecodeAllThePage(data)

            at = re.search(r'var\s*at\s*=\s*"([^"]*?)"', data).group(1)

            #l = re.search(r'\.get\( *"/player/get_md5.php",.+?link_1: *(.+?), *server_2: *(.+?), *vid: *"([^"]+)"}\)', data)
            #if l:
            #   vid_server = re.search(r'var ' + l.group(2) + ' = "([^"]+)"', data).group(1)
#
#               vid_link = re.search(r'var ' + l.group(1) + ' = "([^"]+)"', data).group(1)
#
#               vid_key = l.group(3)
#            else:
#                VSlog("prob 3")
#
            #new video id, not really usefull
            # m = re.search(r' vid: "([a-zA-Z0-9]+)"}', data)
            # if m:
                # id = m.group(1)

#            if vid_server and vid_link and at and vid_key:
#
###                #get_data = {'server': vid_server.group(1), 'link': vid_link.group(1), 'at': at.group(1), 'adb': '0/','b':'1','vid':id} #,'iss':'MzEuMz'
#                get_data = {'server_2': vid_server, 'link_1': vid_link, 'at': at.group(1), 'adb': '0/','b':'1','vid':vid_key}
#
#                headers['x-requested-with'] = 'XMLHttpRequest'
##
#                req = urllib2.Request(Host + "/player/get_md5.php?" + urllib.urlencode(get_data), None, headers)
##                try:
#                    response = urllib2.urlopen(req)
#                except urllib2.URLError, e:
#                    VSlog(str(e.read()))
#                    VSlog(str(e.reason))
#
#                data = response.read()
#                #VSlog(data)
#                response.close()
#
#                file_url = re.search(r'"obf_link"\s*:\s*"([^"]*?)"', data)
#
#                if file_url:
#                    list_url = decodeUN(file_url.group(1).replace('\\', ''))
#
                #Hack, je sais pas si ca va durer longtemps, mais indispensable sur certains fichiers
                #list_url = list_url.replace("?socket", ".mp4.m3u8")

#            else:
#                VSlog('prb2')

        nameVar = re.search('true.+?\s*.+?link_1="\+encodeURIComponent\((.+?)\)\+"&server_2="\+encodeURIComponent\((.+?)\)',data)
        var1 = re.search('var '+nameVar.group(1)+' = "(.+?)"', data).group(1)
        var2 = re.search('var '+nameVar.group(2)+' = "(.+?)"', data).group(1)

        #bricolage
        api_call = "https://hqq.tv/player/get_md5.php?ver=2&at="+urllib.quote(at, safe='~()*!.\'')+"&adb=1&b=1&link_1="+urllib.quote(var1, safe='~()*!.\'')+"&server_2="+urllib.quote(var2, safe='~()*!.\'')+"&vid="+urllib.quote(vid, safe='~()*!.\'')+"&ext=.mp4.m3u8"

        #use a fake headers
        #Header = 'User-Agent=' + UA
        api_call = api_call #+ '|' + Header >> pas besoin pour l'instant

        if not (api_call == False):
            return True, api_call

        return False, False