def list_episodes(nazwaSerii, wersja, fanart): lista = [] lista_tytulow = [] ocena = [] cookie = cache.cache_get('strefadb_cookie')['value'] if type(cookie) is dict: cookie = cookie['value'] HEADERS['Cookie'] = cookie url = 'https://strefadb.pl/odcinki/' + nazwaSerii + '.html' result = s.get(url, headers=HEADERS).content test = client.parseDOM(result, 'ul', attrs={'class': 'lista-odcinkow'}) test = client.parseDOM(test, 'li') for item in test: if 'a href' in item and '?typ' not in item and not 'ul class' in item: lista.append(item) for item in lista: try: item = client.parseDOM(item, 'a') lista_tytulow.append(str(item[0])) ocena.append(float(lista_tytulow[-1][-5:-1])) lista_tytulow[-1] = lista_tytulow[-1][:-7] except: pass i = 1 while i < len(lista_tytulow) + 1: url = 'https://strefadb.pl/odcinki/' + nazwaSerii + '-' + str( i) + '.html' addon.addDir(str(i) + ' ' + str(lista_tytulow[i - 1]), url, mode='ListowanieLinkow', fanart=fanart, rating=ocena[i - 1]) i += 1
def resolve(self, url): try: #import pydevd #pydevd.settrace(stdoutToServer=True, stderrToServer=True) #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, e: 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
s.post('https://strefadb.pl/', data=data, headers=headers) cookie = s.cookies.get_dict() cookie_string = "; ".join( [str(x) + "=" + str(y) for x, y in cookie.items()]) cache.cache_insert('strefadb_cookie', str(cookie_string)) SUBCATEGORIES('Lektor') elif mode == 'Lektor': log('Mode Lektor') SUBCATEGORIES('Lektor') elif mode == 'ListowanieLinkow': from urlparse import urlparse cookie = cache.cache_get('strefadb_cookie') if type(cookie) is dict: cookie = cookie['value'] HEADERS['Cookie'] = cookie link = params['url'] result = s.get(link, headers=HEADERS).content result = client.parseDOM(result, 'div', attrs={'class': 'video-holder'}) result = client.parseDOM(result, 'tr') for item in result: try: link = client.parseDOM(item, 'a', ret='href')[0] except: continue content = client.parseDOM(item, 'td') napisy = ''