Ejemplo n.º 1
0
 def getVideoLinks(self, videoUrl):
     printDBG("KissAnimeTo.getVideoLinks [%s]" % videoUrl)
     urlTab = []
     
     if 'kissanime' not in videoUrl:
         return self.up.getVideoLinkExt(videoUrl)
     #if '&s=' in videoUrl:
     
     def _decUrl(data, password):
         printDBG('PASSWORD 2: ' + sha256(password).hexdigest())
         key = a2b_hex( sha256(password).hexdigest() )
         printDBG("key: [%s]" % key)
         iv = a2b_hex("a5e8d2e9c1721ae0e84ad660c472c1f3")
         encrypted = base64.b64decode(data)
         cipher = AES_CBC(key=key, keySize=32)
         return cipher.decrypt(encrypted, iv)
         
     sts, data = self.getPage(videoUrl) 
     if not sts: return urlTab
     if 'AreYouHuman' in self.cm.meta['url']:
         SetIPTVPlayerLastHostError('Captcha failed! Try to use the RapidVideo hosting if available.')
     
     keySeed = self.cm.ph.getSearchGroups(data, r'"(\\x[^"]+?)"')[0]
     try: keySeed = keySeed.decode('string-escape')
     except Exception: printExc()
     
     printDBG('keySeed: ' + keySeed)
     
     tmpTab = self.cm.ph.getAllItemsBeetwenMarkers(data, 'asp.wrap(', ')', False)
     for tmp in tmpTab:
         tmp = tmp.strip()
         if tmp.startswith('"'):
             tmp = tmp[1:-1]
         else:
             tmp = self.cm.ph.getSearchGroups(data, '''var %s =[^'^"]*?["']([^"^']+?)["']''')[0]
         if tmp == '': continue
         try:
             tmp = base64.b64decode(tmp)
             tmp = self.cm.ph.getAllItemsBeetwenMarkers(tmp, '<a ', '</a>')
             for item in tmp:
                 url  = self.cm.ph.getSearchGroups(item, '''href="([^"]+?)"''')[0]
                 if 'googlevideo.com' not in url: continue
                 name = self.cleanHtmlStr(item)
                 urlTab.append({'name':name, 'url':url, 'need_resolve':0})
         except Exception:
             printExc()
             continue
            
     tmpTab = self.cm.ph.getDataBeetwenMarkers(data, '<select id="slcQualix">', '</select>', False)[1]
     tmpTab = self.cm.ph.getAllItemsBeetwenMarkers(tmpTab, '<option', '</option>')
     for item in tmpTab:
         url  = self.cm.ph.getSearchGroups(item, '''value="([^"]+?)"''')[0]
         if '' == url: continue
         try:
             printDBG(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> url[%s]" % url)
             url = _decUrl(url, base64.b64decode('bmhjc2NzZGJjc2R0ZW5lNzIzMGNzYjZuMjNuY2NzZGxuMjEzem5zZGJjc2QwMTI5MzM0NzM='))
             printDBG("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< url[%s]" % url)
             url = strwithmeta(url, {'Referer':'http://kissanime.ru/Scripts/jwplayer/jwplayer.flash.swf'})
         except Exception:
             printExc()
             continue
         if not self.cm.isValidUrl(url): continue
         name = self.cleanHtmlStr(item)
         urlTab.append({'name':name, 'url':url, 'need_resolve':0})
         
     if 0 < len(urlTab):
         max_bitrate = int(config.plugins.iptvplayer.kissanime_defaultformat.value)
         def __getLinkQuality( itemLink ):
             try:
                 return int(self.cm.ph.getSearchGroups('|'+itemLink['name']+'|', '[^0-9]([0-9]+?)[^0-9]')[0])
             except Exception: return 0
         urlTab = CSelOneLink(urlTab, __getLinkQuality, max_bitrate).getBestSortedList()
         for idx in range(len(urlTab)):
             urlTab[idx]['url'] = strwithmeta(urlTab[idx]['url'], {'iptv_wget_retry_on_http_error':'429', 'iptv_wget_waitretry':'0.1', 'iptv_wget_tries':'1000'})
             
         
     data = self.cm.ph.getAllItemsBeetwenMarkers(data, '<iframe ', '>', withMarkers=True, caseSensitive=False)
     for item in data:
         url  = self.cm.ph.getSearchGroups(item, '''<iframe[^>]+?src=['"]([^'^"]+?)['"]''',  grupsNum=1, ignoreCase=True)[0]
         url = self.getFullUrl(url)
         if url.startswith('http') and 'facebook.com' not in url and 1 == self.up.checkHostSupport(url):
             urlTab.extend(self.up.getVideoLinkExt(url))
     
     return urlTab
Ejemplo n.º 2
0
    def getVideoLinks(self, videoUrl):
        printDBG("KissCartoonMe.getVideoLinks [%s]" % videoUrl)
        urlTab = []

        if 'kisscartoon' not in videoUrl:
            return self.up.getVideoLinkExt(videoUrl)
        #if '&s=' in videoUrl:

        sts, data = self.getPage(videoUrl)
        if not sts: return urlTab

        tmpTab = self.cm.ph.getAllItemsBeetwenMarkers(data, 'asp.wrap(', ')',
                                                      False)
        for tmp in tmpTab:
            tmp = tmp.strip()
            if tmp.startswith('"'):
                tmp = tmp[1:-1]
            else:
                tmp = self.cm.ph.getSearchGroups(
                    data, '''var %s =[^'^"]*?["']([^"^']+?)["']''')[0]
            if tmp == '': continue
            try:
                tmp = base64.b64decode(tmp)
                tmp = self.cm.ph.getAllItemsBeetwenMarkers(tmp, '<a ', '</a>')
                for item in tmp:
                    url = self.cm.ph.getSearchGroups(item,
                                                     '''href="([^"]+?)"''')[0]
                    if 'googlevideo.com' not in url: continue
                    name = self.cleanHtmlStr(item)
                    urlTab.append({
                        'name': name,
                        'url': url,
                        'need_resolve': 0
                    })
            except Exception:
                printExc()
                continue

        def _decUrl(data, password):
            key = a2b_hex(sha256(password).hexdigest())
            iv = a2b_hex("a5e8d2e9c1721ae0e84ad660c472c1f3")
            encrypted = base64.b64decode(data)
            cipher = AES_CBC(key=key, keySize=32)
            return cipher.decrypt(encrypted, iv)

        def _decUrlOld(data):
            password = base64.b64decode('X1dyeExsM3JuQTQ4aWFmZ0N5Xw==')[1:-1]
            salt = base64.b64decode('X0NhcnRLUyQyMTQxI18=')[1:-1]
            iv = a2b_hex(
                base64.b64decode(
                    'X2E1ZThkMmU5YzE3MjFhZTBlODRhZDY2MGM0NzJjMWYzXw==')[1:-1])
            encrypted = base64.b64decode(data)
            iterations = 1000
            keySize = 16
            key = pbkdf2(password, salt, iterations, keySize)
            cipher = AES_CBC(key=key, keySize=16)
            return cipher.decrypt(encrypted, iv)

        tmpTab = self.cm.ph.getDataBeetwenMarkers(
            data, '<select id="selectQuality">', '</select>', False)[1]
        tmpTab = self.cm.ph.getAllItemsBeetwenMarkers(tmpTab, '<option',
                                                      '</option>')
        if len(tmpTab):
            password = self.getPage(self.getFullUrl('/External/RSK'),
                                    post_data={})[1]
        for item in tmpTab:
            url = self.cm.ph.getSearchGroups(item, '''value="([^"]+?)"''')[0]
            if '' == url: continue
            try:
                printDBG(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> url[%s]" % url)
                url = _decUrl(url, password)
                printDBG("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< url[%s]" % url)
            except Exception:
                printExc()
                continue
            if '://' not in url: continue
            name = self.cleanHtmlStr(item)
            urlTab.append({'name': name, 'url': url, 'need_resolve': 0})

        if 0 < len(urlTab):
            max_bitrate = int(
                config.plugins.iptvplayer.kisscartoon_defaultformat.value)

            def __getLinkQuality(itemLink):
                try:
                    return int(
                        self.cm.ph.getSearchGroups(
                            '|' + itemLink['name'] + '|',
                            '[^0-9]([0-9]+?)[^0-9]')[0])
                except Exception:
                    return 0

            urlTab = CSelOneLink(urlTab, __getLinkQuality,
                                 max_bitrate).getBestSortedList()

        data = self.cm.ph.getAllItemsBeetwenMarkers(data,
                                                    '<iframe ',
                                                    '>',
                                                    withMarkers=True,
                                                    caseSensitive=False)
        for item in data:
            url = self.cm.ph.getSearchGroups(
                item,
                '''<iframe[^>]+?src=['"]([^'^"]+?)['"]''',
                grupsNum=1,
                ignoreCase=True)[0]
            url = self._getFullUrl(url)
            if url.startswith(
                    'http'
            ) and 'facebook.com' not in url and 1 == self.up.checkHostSupport(
                    url):
                urlTab.extend(self.up.getVideoLinkExt(url))
        return urlTab
Ejemplo n.º 3
0
 def getVideoLinks(self, videoUrl):
     printDBG("KissCartoonMe.getVideoLinks [%s]" % videoUrl)
     urlTab = []
     
     if 'kisscartoon' not in videoUrl:
         return self.up.getVideoLinkExt(videoUrl)
         
         
     sts, data = self.getPage(videoUrl) 
     if not sts: return urlTab
     
     tmpTab = self.cm.ph.getAllItemsBeetwenMarkers(data, 'asp.wrap(', ')', False)
     for tmp in tmpTab:
         tmp = tmp.strip()
         if tmp.startswith('"'):
             tmp = tmp[1:-1]
         else:
             tmp = self.cm.ph.getSearchGroups(data, '''var %s =[^'^"]*?["']([^"^']+?)["']''')[0]
         if tmp == '': continue
         try:
             tmp = base64.b64decode(tmp)
             tmp = self.cm.ph.getAllItemsBeetwenMarkers(tmp, '<a ', '</a>')
             for item in tmp:
                 url  = self.cm.ph.getSearchGroups(item, '''href="([^"]+?)"''')[0]
                 if 'googlevideo.com' not in url: continue
                 name = self.cleanHtmlStr(item)
                 urlTab.append({'name':name, 'url':url, 'need_resolve':0})
         except:
             printExc()
             continue
             
     def _decUrl(data):
         password = base64.b64decode('X1dyeExsM3JuQTQ4aWFmZ0N5Xw==')[1:-1]
         salt = base64.b64decode('X0NhcnRLUyQyMTQxI18=')[1:-1]
         iv = a2b_hex(base64.b64decode('X2E1ZThkMmU5YzE3MjFhZTBlODRhZDY2MGM0NzJjMWYzXw==')[1:-1])
         encrypted = base64.b64decode(data)
         iterations = 1000
         keySize = 16
         key = pbkdf2(password, salt, iterations, keySize)
         cipher = AES_CBC(key=key, keySize=16)
         return cipher.decrypt(encrypted, iv)
     
     tmpTab = self.cm.ph.getDataBeetwenMarkers(data, '<select id="selectQuality">', '</select>', False)[1]
     tmpTab = self.cm.ph.getAllItemsBeetwenMarkers(tmpTab, '<option', '</option>')
     for item in tmpTab:
         url  = self.cm.ph.getSearchGroups(item, '''value="([^"]+?)"''')[0]
         if '' == url: continue
         try:
             #printDBG(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> url[%s]" % url)
             url = _decUrl(url)
             #printDBG("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< url[%s]" % url)
         except:
             #printExc()
             continue
         if '://' not in url: continue
         name = self.cleanHtmlStr(item)
         urlTab.append({'name':name, 'url':url, 'need_resolve':0})
         
     if 0 < len(urlTab):
         max_bitrate = int(config.plugins.iptvplayer.kisscartoon_defaultformat.value)
         def __getLinkQuality( itemLink ):
             try:
                 return int(self.cm.ph.getSearchGroups('|'+itemLink['name']+'|', '[^0-9]([0-9]+?)[^0-9]')[0])
             except: return 0
         urlTab = CSelOneLink(urlTab, __getLinkQuality, max_bitrate).getBestSortedList()         
         
     data = self.cm.ph.getAllItemsBeetwenMarkers(data, '<iframe ', '>', withMarkers=True, caseSensitive=False)
     for item in data:
         url  = self.cm.ph.getSearchGroups(item, '''<iframe[^>]+?src=['"]([^'^"]+?)['"]''',  grupsNum=1, ignoreCase=True)[0]
         url = self._getFullUrl(url)
         if url.startswith('http') and 'facebook.com' not in url and 1 == self.up.checkHostSupport(url):
             urlTab.extend(self.up.getVideoLinkExt(url))
     return urlTab
Ejemplo n.º 4
0
    def getVideoLinks(self, videoUrl):
        printDBG("KissAnimeTo.getVideoLinks [%s]" % videoUrl)
        urlTab = []

        if 'kissanime' not in videoUrl:
            return self.up.getVideoLinkExt(videoUrl)
        #if '&s=' in videoUrl:

        sts, data = self.getPage(videoUrl)
        if not sts: return urlTab

        tmpTab = self.cm.ph.getAllItemsBeetwenMarkers(data, 'asp.wrap(', ')',
                                                      False)
        for tmp in tmpTab:
            tmp = tmp.strip()
            if tmp.startswith('"'):
                tmp = tmp[1:-1]
            else:
                tmp = self.cm.ph.getSearchGroups(
                    data, '''var %s =[^'^"]*?["']([^"^']+?)["']''')[0]
            if tmp == '': continue
            try:
                tmp = base64.b64decode(tmp)
                tmp = self.cm.ph.getAllItemsBeetwenMarkers(tmp, '<a ', '</a>')
                for item in tmp:
                    url = self.cm.ph.getSearchGroups(item,
                                                     '''href="([^"]+?)"''')[0]
                    if 'googlevideo.com' not in url: continue
                    name = self.cleanHtmlStr(item)
                    urlTab.append({
                        'name': name,
                        'url': url,
                        'need_resolve': 0
                    })
            except Exception:
                printExc()
                continue

        tmpTab = self.cm.ph.getDataBeetwenMarkers(
            data, '<select id="selectQuality">', '</select>', False)[1]
        tmpTab = self.cm.ph.getAllItemsBeetwenMarkers(tmpTab, '<option',
                                                      '</option>')
        for item in tmpTab:
            url = self.cm.ph.getSearchGroups(item, '''value="([^"]+?)"''')[0]
            if '' == url: continue
            try:
                printDBG(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> url[%s]" % url)
                url = base64.b64decode(url)
                printDBG("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< url[%s]" % url)
            except Exception:
                printExc()
                continue
            if not self.cm.isValidUrl(url): continue
            name = self.cleanHtmlStr(item)
            urlTab.append({'name': name, 'url': url, 'need_resolve': 0})

        if 0 < len(urlTab):
            max_bitrate = int(
                config.plugins.iptvplayer.kissanime_defaultformat.value)

            def __getLinkQuality(itemLink):
                try:
                    return int(
                        self.cm.ph.getSearchGroups(
                            '|' + itemLink['name'] + '|',
                            '[^0-9]([0-9]+?)[^0-9]')[0])
                except Exception:
                    return 0

            urlTab = CSelOneLink(urlTab, __getLinkQuality,
                                 max_bitrate).getBestSortedList()

        data = self.cm.ph.getAllItemsBeetwenMarkers(data,
                                                    '<iframe ',
                                                    '>',
                                                    withMarkers=True,
                                                    caseSensitive=False)
        for item in data:
            url = self.cm.ph.getSearchGroups(
                item,
                '''<iframe[^>]+?src=['"]([^'^"]+?)['"]''',
                grupsNum=1,
                ignoreCase=True)[0]
            url = self._getFullUrl(url)
            if url.startswith(
                    'http'
            ) and 'facebook.com' not in url and 1 == self.up.checkHostSupport(
                    url):
                urlTab.extend(self.up.getVideoLinkExt(url))
        return urlTab