def resolve(self, url): try: cookies = cache.cache_get('alltube_cookie')['value'] myurl = url.split('?') mycookie = client.request(myurl[0], headers={'Cookie': cookies}, output='cookie', error=True) tmp = 'ZGVmIGFiYyhpbl9hYmMpOg0KICAgIGRlZiByaGV4KGEpOg0KICAgICAgICBoZXhfY2hyID0gJzAxMjM0NTY3ODlhYmNkZWYnDQogICAgICAgIHJldCA9ICcnDQogICAgICAgIGZvciBpIGluIHJhbmdlKDQpOg0KICAgICAgICAgICAgcmV0ICs9IGhleF9jaHJbKGEgPj4gKGkgKiA4ICsgNCkpICYgMHgwRl0gKyBoZXhfY2hyWyhhID4+IChpICogOCkpICYgMHgwRl0NCiAgICAgICAgcmV0dXJuIHJldA0KICAgIGRlZiBoZXgodGV4dCk6DQogICAgICAgIHJldCA9ICcnDQogICAgICAgIGZvciBpIGluIHJhbmdlKGxlbih0ZXh0KSk6DQogICAgICAgICAgICByZXQgKz0gcmhleCh0ZXh0W2ldKQ0KICAgICAgICByZXR1cm4gcmV0DQogICAgZGVmIGFkZDMyKGEsIGIpOg0KICAgICAgICByZXR1cm4gKGEgKyBiKSAmIDB4RkZGRkZGRkYNCiAgICBkZWYgY21uKGEsIGIsIGMsIGQsIGUsIGYpOg0KICAgICAgICBiID0gYWRkMzIoYWRkMzIoYiwgYSksIGFkZDMyKGQsIGYpKTsNCiAgICAgICAgcmV0dXJuIGFkZDMyKChiIDw8IGUpIHwgKGIgPj4gKDMyIC0gZSkpLCBjKQ0KICAgIGRlZiBmZihhLCBiLCBjLCBkLCBlLCBmLCBnKToNCiAgICAgICAgcmV0dXJuIGNtbigoYiAmIGMpIHwgKCh+YikgJiBkKSwgYSwgYiwgZSwgZiwgZykNCiAgICBkZWYgZ2coYSwgYiwgYywgZCwgZSwgZiwgZyk6DQogICAgICAgIHJldHVybiBjbW4oKGIgJiBkKSB8IChjICYgKH5kKSksIGEsIGIsIGUsIGYsIGcpDQogICAgZGVmIGhoKGEsIGIsIGMsIGQsIGUsIGYsIGcpOg0KIC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eHQgPSAnJzsNCiAgICAgICAgdHh0TGVuID0gbGVuKHRleHQpDQogICAgICAgIHJldCA9IFsxNzMyNTg0MTkzLCAtMjcxNzMzODc5LCAtMTczMjU4NDE5NCwgMjcxNzMzODc4XQ0KICAgICAgICBpID0gNjQNCiAgICAgICAgd2hpbGUgaSA8PSBsZW4odGV4dCk6DQogICAgICAgICAgICBjcnlwdGN5Y2xlKHJldCwgY3J5cHRibGsodGV4dFsnc3Vic3RyaW5nJ10oaSAtIDY0LCBpKSkpDQogICAgICAgICAgICBpICs9IDY0DQogICAgICAgIHRleHQgPSB0ZXh0W2kgLSA2NDpdDQogICAgICAgIHRtcCA9IFswLCAwLCAwLCAwLCAwLCAwLCAwLCAwLCAwLCAwLCAwLCAwLCAwLCAwLCAwLCAwXQ0KICAgICAgICBpID0gMA0KICAgICAgICB3aGlsZSBpIDwgbGVuKHRleHQpOg0KICAgICAgICAgICAgdG1wW2kgPj4gMl0gfD0gb3JkKHRleHRbaV0pIDw8ICgoaSAlIDQpIDw8IDMpDQogICAgICAgICAgICBpICs9IDENCiAgICAgICAgdG1wW2kgPj4gMl0gfD0gMHg4MCA8PCAoKGkgJSA0KSA8PCAzKQ0KICAgICAgICBpZiBpID4gNTU6DQogICAgICAgICAgICBjcnlwdGN5Y2xlKHJldCwgdG1wKTsNCiAgICAgICAgICAgIGZvciBpIGluIHJhbmdlKDE2KToNCiAgICAgICAgICAgICAgICB0bXBbaV0gPSAwDQogICAgICAgIHRtcFsxNF0gPSB0eHRMZW4gKiA4Ow0KICAgICAgICBjcnlwdGN5Y2xlKHJldCwgdG1wKTsNCiAgICAgICAgcmV0dXJuIHJldA0KICAgIGRlZiByZXplZG93YSh0ZXh0KToNCiAgICAgICAgcmV0dXJuIGhleChqY3N5cyh0ZXh0KSkNCiAgICByZXR1cm4gcmV6ZWRvd2EoaW5fYWJjKQ0K' tmp = base64.b64decode(tmp) _myFun = compile(tmp, '', 'exec') vGlobals = {"__builtins__": None, 'len': len, 'list': list, 'ord': ord, 'range': range} vLocals = {'abc': ''} exec _myFun in vGlobals, vLocals myFun1 = vLocals['abc'] data = client.request(urlparse.urljoin(self.base_link, '/jsverify.php?op=tag'), cookie=mycookie) data = byteify(json.loads(data)) d = {} for i in range(len(data['key'])): d[data['key'][i]] = data['hash'][i] tmp = '' for k in sorted(d.keys()): tmp += d[k] mycookie = 'tmvh=%s;%s' % (myFun1(tmp), mycookie) link = client.request(myurl[-1], cookie=mycookie) match = re.search('<iframe src="(.+?)"', link) if match: linkVideo = match.group(1) if linkVideo.startswith("//"): linkVideo = linkVideo.replace("//", "http://") return linkVideo return linkVideo return except: return
def sources(self, url, hostDict, hostprDict): try: sources = [] if url == None: return sources url = urlparse.urljoin(self.base_link, url) cookies = cache.cache_get('alltube_cookie')['value'] result = client.request(url, headers={'Cookie': cookies}) links = client.parseDOM(result, 'tr') links = [(client.parseDOM(i, 'a', attrs={'class': 'watch'}, ret='href')[0], client.parseDOM(i, 'img', ret='alt')[0], client.parseDOM(i, 'td', attrs={'class': 'text-center'})[0]) for i in links] for i in links: try: url1 = '%s?%s' % (url, i[0]) url1 = url1.encode('utf-8') language, info = self.get_language_by_type(i[2]); sources.append({'source': i[1].encode('utf-8'), 'quality': 'SD', 'language': language, 'url': url1, 'info': info, 'direct': False, 'debridonly': False}) except: pass return sources except: return sources
def resolve(self, url): try: # cookies = client.request(url, output='cookie') # verifyGet = client.request(self.verify, cookie = cookies) # cookies = cookies + ";tmvh=" + self.crazy_cookie_hash(verifyGet) cookies = cache.cache_get('szukajka_cookie') replace = re.findall("""tmvh=(.*)""", str(cookies['value']))[0] cookies = str(cookies['value']) verifyGet = client.request(self.verify, cookie=cookies) tmvh = self.crazy_cookie_hash(verifyGet) cookies = cookies.replace(replace, tmvh) test4 = client.request(url, cookie=cookies) test5 = client.parseDOM(test4, 'a', attrs={'class': 'submit'}, ret='href')[0] replace = re.findall("""tmvh=(.*)""", cookies)[0] verifyGet = client.request(self.verify, cookie=cookies) tmvh = self.crazy_cookie_hash(verifyGet) cookies = cookies.replace(replace, tmvh) test6 = client.request(test5, cookie=cookies) test7 = client.parseDOM(test6, 'iframe', ret='src') video_url = test7[0].replace("javascript:window.location.replace('", "").replace("')", "") return video_url except Exception as e: return
def episode(self, url, imdb, tvdb, title, premiered, season, episode): try: if url == None: return cookies = cache.cache_get('alltube_cookie')['value'] txts = 's%02de%02d' % (int(season), int(episode)) result = client.request(url, headers={'Cookie': cookies}) # result = requests.get(url).content result = client.parseDOM(result, 'li', attrs={'class': 'episode'}) result = [i for i in result if txts in i][0] url = client.parseDOM(result, 'a', ret='href')[0] url = url.encode('utf-8') return url except: return
def episode(self, url, imdb, tvdb, title, premiered, season, episode): try: if url == None: return cookies = cache.cache_get('alltube_cookie')['value'] self.anime = source_utils.is_anime('show', 'tvdb', tvdb) if self.anime: txts = 's01e%02d' % int(source_utils.absoluteNumber(tvdb, episode, season)) else: txts = 's%02de%02d' % (int(season), int(episode)) result = client.request(url, headers={'Cookie': cookies}) # result = requests.get(url).content result = client.parseDOM(result, 'li', attrs={'class': 'episode'}) result = [i for i in result if txts in i][0] url = client.parseDOM(result, 'a', ret='href')[0] url = url.encode('utf-8') return url except: return
def sources(self, url, hostDict, hostprDict): try: sources = [] if url == None: return sources cookies = cache.cache_get('naszekino_cookie') result = client.request(url, cookie=cookies) result = client.parseDOM(result, 'table', attrs={'class': 'table table-bordered'}) result = client.parseDOM(result, 'tr') for item in result: try: link = client.parseDOM(item, 'td', attrs={'class': 'link-to-video'}) link = str(client.parseDOM(link, 'a', ret='href')[0]) temp = client.parseDOM(item, 'td') wersja = str(temp[1]) lang, info = self.get_lang_by_type(wersja) valid, host = source_utils.is_host_valid(link, hostDict) jakosc = str(temp[2]).lower() if "wysoka" in jakosc: q = "HD" else: q = source_utils.check_sd_url(link) sources.append({ 'source': host, 'quality': q, 'language': lang, 'url': link, 'info': info, 'direct': False, 'debridonly': False }) except: continue return sources except: return sources