def _get_sources(self, name, url): try: headers = {'User-Agent': client.agent()} r = cfScraper.get(url, headers=headers).content r = ensure_text(r, errors='replace') name = client.replaceHTMLCodes(name) try: _name = name.lower().replace('rr', '').replace('nf', '').replace( 'ul', '').replace('cu', '') except: _name = name l = dom_parser2.parse_dom(r, 'pre', {'class': 'links'}) s = '' for i in l: s += i.content urls = re.findall( r'''((?:http|ftp|https)://[\w_-]+(?:(?:\.[\w_-]+)+)[\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-])''', i.content, flags=re.MULTILINE | re.DOTALL) urls = [ i for i in urls if not i.endswith(('.rar', '.zip', '.iso', '.idx', '.sub', '.srt')) ] for url in urls: if url in str(self.sources): continue valid, host = source_utils.is_host_valid(url, self.hostDict) if not valid: continue host = client.replaceHTMLCodes(host) #host = host.encode('utf-8') quality, info = source_utils.get_release_quality(name, url) try: size = re.findall( '((?:\d+\.\d+|\d+\,\d+|\d+)\s*(?:GiB|MiB|GB|MB))', name)[0] dsize, isize = source_utils._size(size) except BaseException: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) self.sources.append({ 'source': host, 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': _name }) except: log_utils.log('RMZ - Exception', 1) pass
def sources(self, url, hostDict, hostprDict): sources = [] try: self.hostDict = hostDict + hostprDict if url is None: return sources if debrid.status() is False: return data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) self.title = data['tvshowtitle'] if 'tvshowtitle' in data else data['title'] self.title = cleantitle.get_query(self.title) self.hdlr = 'S%02dE%02d' % (int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else data['year'] query = '%s S%02dE%02d' % (self.title, int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else '%s %s' % (self.title, data['year']) query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query) if 'tvshowtitle' in data: url = self.tvsearch.format(quote(query)) url = urljoin(self.base_link, url) else: url = self.moviesearch.format(quote(query)) url = urljoin(self.base_link, url) r = cfScraper.get(url).content r = ensure_text(r, errors='ignore') posts = client.parseDOM(r, 'table', attrs={'class': 'table2'})[0] posts = client.parseDOM(posts, 'tr') for post in posts: link = client.parseDOM(post, 'a', ret='href')[0] hash = re.findall(r'(\w{40})', link, re.I) if hash: url = 'magnet:?xt=urn:btih:' + hash[0] name = link.split('title=')[1] t = name.split(self.hdlr)[0] if not cleantitle.get(re.sub('(|)', '', t)) == cleantitle.get(self.title): continue try: y = re.findall('[\.|\(|\[|\s|\_|\-](S\d+E\d+|S\d+)[\.|\)|\]|\s|\_|\-]', name, re.I)[-1].upper() except: y = re.findall('[\.|\(|\[|\s\_|\-](\d{4})[\.|\)|\]|\s\_|\-]', name, re.I)[-1].upper() if not y == self.hdlr: continue quality, info = source_utils.get_release_quality(name, name) try: size = re.findall('((?:\d+\,\d+\.\d+|\d+\.\d+|\d+\,\d+|\d+)\s*(?:GiB|MiB|GB|MB))', post)[0] dsize, isize = source_utils._size(size) except: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) sources.append({'source': 'Torrent', 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name}) return sources except: log_utils.log('lime0 - Exception', 1) return sources
def _get_items(self, url): try: r = cfScraper.get(url).content r = ensure_text(r, errors='replace') posts = client.parseDOM(r, 'tbody')[0] posts = client.parseDOM(posts, 'tr') for post in posts: data = dom.parse_dom(post, 'a', req='href')[1] link = urljoin(self.base_link, data.attrs['href']) name = data.content t = name.split(self.hdlr)[0] if not cleantitle.get(re.sub('(|)', '', t)) == cleantitle.get( self.title): continue try: y = re.findall( '[\.|\(|\[|\s|\_|\-](S\d+E\d+|S\d+)[\.|\)|\]|\s|\_|\-]', name, re.I)[-1].upper() except BaseException: y = re.findall( '[\.|\(|\[|\s\_|\-](\d{4})[\.|\)|\]|\s\_|\-]', name, re.I)[-1].upper() if not y == self.hdlr: continue try: size = re.findall( '((?:\d+\,\d+\.\d+|\d+\.\d+|\d+\,\d+|\d+)\s*(?:GiB|MiB|GB|MB))', post)[0] dsize, isize = source_utils._size(size) except BaseException: dsize, isize = 0.0, '' self.items.append((name, link, isize, dsize)) return self.items except: log_utils.log('1337x_exc0', 1) return self.items
def _get_items(self, url): items = [] try: headers = {'User-Agent': client.agent()} r = client.request(url, headers=headers) posts = client.parseDOM(r, 'tr', attrs={'class': 't-row'}) posts = [i for i in posts if not 'racker:' in i] for post in posts: data = client.parseDOM(post, 'a', ret='href') url = [i for i in data if 'magnet:' in i][0] name = client.parseDOM(post, 'a', ret='title')[0] t = name.split(self.hdlr)[0] if not cleantitle.get(re.sub('(|)', '', t)) == cleantitle.get( self.title): continue try: y = re.findall( '[\.|\(|\[|\s|\_|\-](S\d+E\d+|S\d+)[\.|\)|\]|\s|\_|\-]', name, re.I)[-1].upper() except BaseException: y = re.findall( '[\.|\(|\[|\s\_|\-](\d{4})[\.|\)|\]|\s\_|\-]', name, re.I)[-1].upper() if not y == self.hdlr: continue try: size = re.findall( '((?:\d+\,\d+\.\d+|\d+\.\d+|\d+\,\d+|\d+)\s*(?:GiB|MiB|GB|MB))', post)[0] dsize, isize = source_utils._size(size) except BaseException: dsize, isize = 0.0, '' items.append((name, url, isize, dsize)) return items except: log_utils.log('glodls2_exc', 1) return items
def get_sources(self, link): try: url = '%s%s' % (self.base_link, link) result = client.request(url) info_hash = re.findall('<kbd>(.+?)<', result, re.DOTALL)[0] url = 'magnet:?xt=urn:btih:' + info_hash name = re.findall('<h3 class="card-title">(.+?)<', result, re.DOTALL)[0] name = unquote_plus(name).replace(' ', '.').replace('Original.Name:.', '').lower() #url = '%s%s%s' % (url1, '&dn=', str(name)) t = name.split(self.hdlr)[0].replace(self.year, '').replace('(', '').replace(')', '').replace('&', 'and').replace('.US.', '.').replace('.us.', '.') if cleantitle.get(t) != cleantitle.get(self.title): return if self.hdlr not in name: return quality, info = source_utils.get_release_quality(name, url) try: size = re.findall('<div class="col-3">File size:</div><div class="col">(.+?)<', result, re.DOTALL)[0] size = re.findall('((?:\d+\,\d+\.\d+|\d+\.\d+|\d+\,\d+|\d+)\s*(?:GiB|MiB|GB|MB))', size)[0] dsize, isize = source_utils._size(size) except: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) self.sources.append({'source': 'torrent', 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name}) except: log_utils.log('YourBT4 - Exception', 1) pass
def sources(self, url, hostDict, hostprDict): sources = [] if not url: return sources try: data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = data['tvshowtitle'] if 'tvshowtitle' in data else data[ 'title'] title = cleantitle.get_query(title) aliases = data['aliases'] hdlr = 'S%02dE%02d' % (int(data['season']), int( data['episode'])) if 'tvshowtitle' in data else data['year'] hdlr2 = 'S%d - %d' % (int(data['season']), int( data['episode'])) if 'tvshowtitle' in data else data['year'] query = '%s %s' % (title, hdlr) query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', '', query) query2 = '%s %s' % (title, hdlr2) query2 = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', '', query2) urls = [] url = self.search_link % quote_plus(query) url = urljoin(self.base_link, url) urls.append(url) url2 = self.search_link % quote_plus(query2) url2 = urljoin(self.base_link, url2) urls.append(url2) for url in urls: try: r = client.request(url) if 'magnet' not in r: return sources r = re.sub(r'\n', '', r) r = re.sub(r'\t', '', r) tbody = client.parseDOM(r, 'tbody') rows = client.parseDOM(tbody, 'tr') for row in rows: links = zip( re.findall('href="(magnet:.+?)"', row, re.DOTALL), re.findall( '((?:\d+\,\d+\.\d+|\d+\.\d+|\d+\,\d+|\d+)\s*(?:GB|GiB|Gb|MB|MiB|Mb))', row, re.DOTALL), [ re.findall( '<td class="text-center">([0-9]+)</td>', row, re.DOTALL) ]) for link in links: url = unquote_plus(link[0]).replace( '&', '&').replace(' ', '.').split('&tr')[0] name = url.split('&dn=')[1] quality, info = source_utils.get_release_quality( name, url) try: size = link[1] dsize, isize = source_utils._size(size) except: dsize, isize = 0.0, '' pass info.insert(0, isize) info = ' | '.join(info) sources.append({ 'source': 'torrent', 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name }) except: log_utils.log('nyaa3 - Exception', 1) return sources return sources except: log_utils.log('nyaa4 - Exception', 1) return sources
def sources(self, url, hostDict, hostprDict): try: sources = [] if url is None: return sources if debrid.status() is False: raise Exception() hostDict = hostprDict + hostDict data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = data['tvshowtitle'] if 'tvshowtitle' in data else data[ 'title'] title = cleantitle.get_query(title) hdlr = 's%02de%02d' % (int(data['season']), int( data['episode'])) if 'tvshowtitle' in data else data['year'] query = '%s s%02de%02d' % ( title, int(data['season']), int(data['episode']) ) if 'tvshowtitle' in data else '%s %s' % (title, data['year']) query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query) try: url = self.search_link % quote_plus(query) url = urljoin(self.base_link, url) r = cfScraper.get(url).content r = ensure_text(r, errors='replace') posts = client.parseDOM(r, 'div', attrs={'class': 'post'}) items = [] for post in posts: try: u = client.parseDOM(post, "div", attrs={"class": "postContent"}) size = re.findall( '((?:\d+\,\d+\.\d+|\d+\.\d+|\d+\,\d+|\d+)\s*(?:GiB|MiB|GB|MB))', u[0])[0] u = client.parseDOM(u, "h2") u = client.parseDOM(u, 'a', ret='href') u = [(i.strip('/').split('/')[-1], i, size) for i in u] items += u except: pass except: pass for item in items: try: name = item[0] name = client.replaceHTMLCodes(name) t = re.sub( '(\.|\(|\[|\s)(\d{4}|S\d*E\d*|S\d*|3D)(\.|\)|\]|\s|)(.+|)', '', name) if not cleantitle.get(t) == cleantitle.get(title): continue quality, info = source_utils.get_release_quality( name, item[1]) try: dsize, isize = source_utils._size(item[2]) except: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) url = item[1] if any(x in url for x in ['.rar', '.zip', '.iso']): raise Exception() url = client.replaceHTMLCodes(url) url = ensure_text(url) host = re.findall('([\w]+[.][\w]+)$', urlparse(url.strip().lower()).netloc)[0] if host not in hostDict: raise Exception() host = client.replaceHTMLCodes(host) host = ensure_text(host) sources.append({ 'source': host, 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name }) except: pass return sources except: return sources
def sources(self, url, hostDict, hostprDict): sources = [] try: if url is None: return sources if debrid.status() is False: raise Exception() data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = data['tvshowtitle'] if 'tvshowtitle' in data else data[ 'title'] hdlr = 'S%02dE%02d' % (int(data['season']), int( data['episode'])) if 'tvshowtitle' in data else data['year'] query = '%s s%02de%02d' % ( data['tvshowtitle'], int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else '%s %s' % ( data['title'], data['year']) query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query) url = self.search_link % quote_plus(query) url = urljoin(self.base_link, url) try: r = client.request(url) posts = client.parseDOM(r, 'tr') for post in posts: link = re.findall( 'a title="Download Torrent Magnet" href="(magnet:.+?)"', post, re.DOTALL) try: size = re.findall( '((?:\d+\,\d+\.\d+|\d+\.\d+|\d+\,\d+|\d+)\s*(?:GiB|MiB|GB|MB))', post)[0] dsize, isize = source_utils._size(size) except BaseException: dsize, isize = 0.0, '' for url in link: url = unquote_plus(url).split('&tr')[0].replace( '&', '&').replace(' ', '.') if hdlr not in url: continue name = url.split('&dn=')[1] quality, info = source_utils.get_release_quality( name, url) if any(x in url for x in [ 'FRENCH', 'Ita', 'italian', 'TRUEFRENCH', '-lat-', 'Dublado' ]): continue info.insert(0, isize) info = ' | '.join(info) sources.append({ 'source': 'Torrent', 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name }) except: return return sources except: return sources
def sources(self, url, hostDict, hostprDict): sources = [] try: if url is None: return sources if debrid.status() is False: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = data['tvshowtitle'] if 'tvshowtitle' in data else data['title'] hdlr = 'S%02dE%02d' % (int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else data['year'] query = '%s %s' % (title, hdlr) query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', '', query) url = self.search_link % quote_plus(query) url = urljoin(self.base_link, url) try: r = client.request(url) links = zip(client.parseDOM(r, 'a', attrs={'class': 'btn btn-default magnet-button stats-action banner-button'}, ret='href'), client.parseDOM(r, 'td', attrs={'class': 'size'})) for link in links: url = link[0].replace('&', '&') url = re.sub(r'(&tr=.+)&dn=', '&dn=', url) # some links on bitlord &tr= before &dn= url = url.split('&tr=')[0] if 'magnet' not in url: continue if any(x in url.lower() for x in ['french', 'italian', 'spanish', 'truefrench', 'dublado', 'dubbed']): continue name = url.split('&dn=')[1] t = name.split(hdlr)[0].replace(data['year'], '').replace('(', '').replace(')', '').replace('&', 'and') if cleantitle.get(t) != cleantitle.get(title): continue if hdlr not in name: continue quality, info = source_utils.get_release_quality(name, url) try: size = link[1] size = str(size) + ' GB' if len(str(size)) == 1 else str(size) + ' MB' dsize, isize = source_utils._size(size) except: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) sources.append({'source': 'torrent', 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name}) return sources except: return sources except: from prophetscrapers.modules import log_utils log_utils.log('bitlord - Exception', 1) return sources
def sources(self, url, hostDict, hostprDict): try: sources = [] if url is None: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = data['tvshowtitle'] title = cleantitle.get_query(title) hdlr = 'S%02dE%02d' % (int(data['season']), int(data['episode'])) query = '%s S%02dE%02d' % ( title, int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else '%s %s' % ( title, data['year']) query = re.sub('(\\\|/| -|:|;|\*|\?|"|<|>|\|)', ' ', query) url = self.search_link % (quote_plus(query).replace('+', '-')) url = urljoin(self.base_link, url) html = client.request(url) try: results = client.parseDOM(html, 'table', attrs={'class': 'forum_header_border'}) for result in results: if 'magnet:' in result: results = result break except Exception: return sources rows = re.findall('<tr name="hover" class="forum_header_border">(.+?)</tr>', results, re.DOTALL) if rows is None: return sources for entry in rows: try: try: columns = re.findall('<td\s.+?>(.+?)</td>', entry, re.DOTALL) derka = re.findall('href="magnet:(.+?)" class="magnet" title="(.+?)"', columns[2], re.DOTALL)[0] name = derka[1] link = 'magnet:%s' % (str(client.replaceHTMLCodes(derka[0]).split('&tr')[0])) t = name.split(hdlr)[0] if not cleantitle.get(re.sub('(|)', '', t)) == cleantitle.get(title): continue except Exception: continue y = re.findall('[\.|\(|\[|\s](\d{4}|S\d*E\d*|S\d*)[\.|\)|\]|\s]', name)[-1].upper() if not y == hdlr: continue quality, info = source_utils.get_release_quality(name, name) try: size = re.findall('((?:\d+\.\d+|\d+\,\d+|\d+)\s*(?:GB|GiB|MB|MiB))', name)[-1] dsize, isize = source_utils._size(size) except Exception: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) sources.append({'source': 'Torrent', 'quality': quality, 'language': 'en', 'url': link, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name}) except Exception: continue check = [i for i in sources if not i['quality'] == 'CAM'] if check: sources = check return sources except: log_utils.log('eztv_exc', 1) return sources
def sources(self, url, hostDict, hostprDict): try: sources = [] if url is None: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = cleantitle.get_query(data['title']) query = '%s %s' % (title, data['year']) #_headers = {'User-Agent': client.agent()} url = self.search_link % quote(query) url = urljoin(self.base_link, url) html = client.request(url) #, headers=_headers) try: results = client.parseDOM(html, 'div', attrs={'class': 'row'})[2] except Exception: return sources items = re.findall( 'class="browse-movie-bottom">(.+?)</div>\s</div>', results, re.DOTALL) if items is None: return sources for entry in items: try: try: link, name = re.findall( '<a href="(.+?)" class="browse-movie-title">(.+?)</a>', entry, re.DOTALL)[0] name = client.replaceHTMLCodes(name) if not cleantitle.get(title) in cleantitle.get(name): continue except Exception: continue y = entry[-4:] if not y == data['year']: continue response = client.request(link) #, headers=_headers) try: entries = client.parseDOM( response, 'div', attrs={'class': 'modal-torrent'}) for torrent in entries: link, name = re.findall( 'href="magnet:(.+?)" class="magnet-download download-torrent magnet" title="(.+?)"', torrent, re.DOTALL)[0] try: _name = name.lower().replace('download', '').replace( 'magnet', '') except: _name = name link = 'magnet:%s' % link link = str( client.replaceHTMLCodes(link).split('&tr')[0]) quality, info = source_utils.get_release_quality( name, link) try: size = re.findall( '((?:\d+\.\d+|\d+\,\d+|\d+)\s*(?:GB|GiB|MB|MiB))', torrent)[-1] dsize, isize = source_utils._size(size) except Exception: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) sources.append({ 'source': 'Torrent', 'quality': quality, 'language': 'en', 'url': link, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': _name }) except Exception: continue except Exception: continue return sources except: from prophetscrapers.modules import log_utils log_utils.log('Ytsam - Exception', 1) return sources
def sources(self, url, hostDict, hostprDict): sources = [] try: if url is None: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = data['tvshowtitle'] if 'tvshowtitle' in data else data[ 'title'] hdlr = 'S%02dE%02d' % (int(data['season']), int( data['episode'])) if 'tvshowtitle' in data else data['year'] query = '%s S%02dE%02d' % ( title, int(data['season']), int(data['episode']) ) if 'tvshowtitle' in data else '%s %s' % (title, data['year']) query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query) #r = client.request(self.base_link) #search_base = client.parseDOM(r, 'form', ret='action')[0] #log_utils.log(search_base) #url = urljoin(search_base, self.search_link) url = urljoin(self.base_link, self.search_link) url = url % quote_plus(query) r = client.request(url) r = client.parseDOM(r, 'h2') z = zip(client.parseDOM(r, 'a', ret='href'), client.parseDOM(r, 'a')) if 'tvshowtitle' in data: posts = [(i[1], i[0]) for i in z] else: posts = [(i[1], i[0]) for i in z] host_dict = hostprDict + hostDict items = [] for post in posts: try: r = client.request(post[1]) r = ensure_text(r, errors='replace') r = client.parseDOM(r, 'div', attrs={'class': 'entry-content cf'})[0] if 'tvshowtitle' in data: z = zip( re.findall(r'<p><b>(%s.+?)</b>' % title, r, re.I | re.S), re.findall(r'<ul>(.+?)</ul>', r, re.S)) for f in z: u = re.findall(r'\'(http.+?)\'', f[1]) + re.findall( r'\"(http.+?)\"', f[1]) u = [i for i in u if '/embed/' not in i] t = f[0] try: s = re.findall( r'((?:\d+\.\d+|\d+\,\d+|\d+|\d+\,\d+\.\d+)\s*(?:GB|GiB|MB|MiB))', t)[0] except: s = '0' items += [(t, i, s) for i in u] else: t = ensure_text(post[0], errors='replace') u = re.findall(r'\'(http.+?)\'', r) + re.findall( '\"(http.+?)\"', r) u = [i for i in u if '/embed/' not in i] try: s = re.findall( r'((?:\d+\.\d+|\d+\,\d+|\d+|\d+\,\d+\.\d+)\s*(?:GB|GiB|MB|MiB))', r)[0] except: s = '0' items += [(t, i, s) for i in u] except: log_utils.log('MYVIDEOLINK ERROR', 1) pass for item in items: try: url = ensure_text(item[1]) url = client.replaceHTMLCodes(url) void = ('.rar', '.zip', '.iso', '.part', '.png', '.jpg', '.bmp', '.gif', 'sub', 'srt') if url.endswith(void): continue name = ensure_text(item[0], errors='replace') name = client.replaceHTMLCodes(name) t = re.sub( r'(\.|\(|\[|\s)(\d{4}|S\d*E\d*|S\d*|3D)(\.|\)|\]|\s|)(.+|)', '', name, re.I) if not cleantitle.get(t) == cleantitle.get(title): continue y = re.findall( r'[\.|\(|\[|\s](\d{4}|S\d*E\d*|S\d*)[\.|\)|\]|\s]', name)[-1].upper() if not y == hdlr: continue valid, host = source_utils.is_host_valid(url, host_dict) if not valid: continue host = client.replaceHTMLCodes(host) quality, info = source_utils.get_release_quality(name, url) try: size = item[2] dsize, isize = source_utils._size(size) except: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) sources.append({ 'source': host, 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': False, 'size': dsize, 'name': name }) except: log_utils.log('MYVIDEOLINK ERROR', 1) pass return sources except: log_utils.log('MYVIDEOLINK ERROR', 1) return sources
def sources(self, url, hostDict, hostprDict): try: sources = [] if url is None: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = data['tvshowtitle'] if 'tvshowtitle' in data else data['title'] title = cleantitle.get_query(title) hdlr = 'S%02dE%02d' % (int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else data['year'] category = '+category%3ATV' if 'tvshowtitle' in data else '+category%3AMovies' query = '%s S%02dE%02d' % ( title, int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else '%s %s' % ( title, data['year']) query = re.sub('(\\\|/| -|:|;|\*|\?|"|<|>|\|)', ' ', query) url = self.search_link % quote_plus(query) url = urljoin(self.base_link, url) + str(category) html = client.request(url) html = html.replace(' ', ' ') try: results = client.parseDOM(html, 'table', attrs={'class': 'table table-condensed table-torrents vmiddle'})[0] except Exception: return sources rows = re.findall('<tr(.+?)</tr>', results, re.DOTALL) if rows is None: return sources for entry in rows: try: try: name = re.findall('<a class=".+?>(.+?)</a>', entry, re.DOTALL)[0] name = client.replaceHTMLCodes(name).replace('<hl>', '').replace('</hl>', '') # t = re.sub('(\.|\(|\[|\s)(\d{4}|S\d*E\d*|S\d*|3D)(\.|\)|\]|\s|)(.+|)', '', name, flags=re.I) if not cleantitle.get(title) in cleantitle.get(name): continue except Exception: continue y = re.findall('[\.|\(|\[|\s](\d{4}|S\d*E\d*|S\d*)[\.|\)|\]|\s]', name)[-1].upper() if not y == hdlr: continue try: link = 'magnet:%s' % (re.findall('href="magnet:(.+?)"', entry, re.DOTALL)[0]) link = client.replaceHTMLCodes(link).split('&tr')[0] except Exception: continue quality, _ = source_utils.get_release_quality(name, link) info = [] try: size = re.findall('((?:\d+\.\d+|\d+\,\d+|\d+)\s*(?:GB|GiB|MB|MiB))', entry)[-1] dsize, isize = source_utils._size(size) except Exception: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) sources.append({'source': 'Torrent', 'quality': quality, 'language': 'en', 'url': link, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name}) except Exception: continue check = [i for i in sources if not i['quality'] == 'CAM'] if check: sources = check return sources except: log_utils.log('ZOOGLE - Exception', 1) return sources
def sources(self, url, hostDict, hostprDict): sources = [] try: if url == None: return sources if debrid.status() is False: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) query = '%s %s' % (data['title'], data['year']) query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query) url = urljoin(self.base_link, self.search_link % quote_plus(query)) r = ensure_str(cfScraper.get(url).content, errors='replace') #log_utils.log('ultrahd_r ' + str(r)) r = client.parseDOM(r, 'div', attrs={'class': 'box-out margin'}) r = [(dom_parser.parse_dom(i, 'div', attrs={'class':'news-title'})) for i in r if data['imdb'] in i] r = [(dom_parser.parse_dom(i[0], 'a', req='href')) for i in r if i] r = [(i[0].attrs['href'], i[0].content) for i in r if i] hostDict = hostprDict + hostDict for item in r: try: data = ensure_text(cfScraper.get(item[0]).content, errors='replace') data = client.parseDOM(data, 'div', attrs={'id': 'r-content'})[0] urls = re.findall(r'\s*<u><a href="(.+?)".+?</a></u>', data, re.S) try: details = client.parseDOM(data, 'div', attrs={'class': 'text_spoiler'})[0] except: details = None if details: _zip = zip([u for u in urls if u.startswith('https://turbobit')], re.findall(r'General : (.+?)<br', details), re.findall(r'Length : (.+?) for', details)) else: _zip = zip([u for u in urls if u.startswith('https://turbobit')], re.findall(r'/uploads/0-0-vip-(.+?).jpg', data, re.I|re.S)) for z in _zip: try: url = ensure_str(client.replaceHTMLCodes(z[0])) name = ensure_str(client.replaceHTMLCodes(z[1])).replace('dual', ' dual ') if 'dublaj' in name.lower(): continue info = [] quality, info = source_utils.get_release_quality(url, name) if quality == 'sd' and 'remux' in name.lower(): quality = '1080p' try: size = re.findall('((?:\d+\.\d+|\d+\,\d+|\d+)\s*(?:GB|GiB|MB|MiB))', z[2])[0] dsize, isize = source_utils._size(size) except: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) if any(x in url for x in ['.rar', '.zip', '.iso']): raise Exception() # if not 'turbobit' in url: # continue sources.append({'source': 'turbobit', 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'size': dsize, 'name': name, 'direct': True, 'debridonly': True}) except: log_utils.log('ultrahd_exc2', 1) pass except: log_utils.log('ultrahd_exc1', 1) pass return sources except: log_utils.log('ultrahd_exc0', 1) return sources
def sources(self, url, hostDict, hostprDict): sources = [] try: if debrid.status() is False: return sources if url is None: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = data['tvshowtitle'] if 'tvshowtitle' in data else data[ 'title'] hdlr = 'S%02dE%02d' % (int(data['season']), int( data['episode'])) if 'tvshowtitle' in data else data['year'] query = '%s S%02dE%02d' % ( data['tvshowtitle'], int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else '%s %s' % ( data['title'], data['year']) query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query) url = self.search_link % quote_plus(query) url = urljoin(self.base_link, url) r = client.request(url) posts = re.findall('<h2 class="title">(.+?)</h2>', r, re.IGNORECASE) hostDict = hostprDict + hostDict urls = [] for item in posts: try: link, name = re.findall('href="(.+?)" title="(.+?)"', item, re.IGNORECASE)[0] if not cleantitle.get(title) in cleantitle.get(name): continue name = client.replaceHTMLCodes(name) try: _name = name.lower().replace('permalink to', '') except: _name = name quality, info = source_utils.get_release_quality( name, link) try: size = re.findall( '((?:\d+\.\d+|\d+\,\d+|\d+)\s*(?:GB|GiB|MB|MiB))', name)[-1] dsize, isize = source_utils._size(size) except Exception: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) links = self.links(link) urls += [(i, quality, info) for i in links] except Exception: pass for item in urls: if 'earn-money' in item[0]: continue if any(x in item[0] for x in ['.rar', '.zip', '.iso']): continue url = client.replaceHTMLCodes(item[0]) #url = url.encode('utf-8') url = ensure_text(url) valid, host = source_utils.is_host_valid(url, hostDict) if not valid: continue host = client.replaceHTMLCodes(host) #host = host.encode('utf-8') host = ensure_text(host) sources.append({ 'source': host, 'quality': item[1], 'language': 'en', 'url': url, 'info': item[2], 'direct': False, 'debridonly': True, 'size': dsize, 'name': _name }) return sources except Exception: return sources
def sources(self, url, hostDict, hostprDict): sources = [] try: if debrid.status() is False: return sources if url is None: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) query = '%s s%02de%02d' % (data['tvshowtitle'], int(data['season']), int(data['episode']))\ if 'tvshowtitle' in data else '%s %s' % (data['title'], data['year']) query = re.sub(u'(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query).lower() url = urljoin(self.base_link, self.search_link % query) #r = client.request(url) #r = requests.get(url).content r = cfScraper.get(url).content r = ensure_text(r, errors='replace').replace(' ', ' ') r = client.parseDOM(r, 'div', attrs={'class': 'col s12'}) posts = client.parseDOM(r, 'div')[1:] posts = [i for i in posts if 'magnet/' in i] for post in posts: links = client.parseDOM(post, 'a', ret='href')[0] url = 'magnet:?xt=urn:btih:' + links.lstrip('magnet/') try: name = client.parseDOM(post, 'a', ret='title')[0] if not query in cleantitle.get_title(name): continue except: name = '' quality, info = source_utils.get_release_quality(name, name) try: size = re.findall(r'<b class="cpill .+?-pill">(.+?)</b>', post)[0] dsize, isize = source_utils._size(size) except: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) sources.append({ 'source': 'Torrent', 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name }) return sources except: log_utils.log('bt4g3 - Exception', 1) return sources
def sources(self, url, hostDict, hostprDict): try: sources = [] if url is None: return sources if debrid.status() is False: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = data['tvshowtitle'] if 'tvshowtitle' in data else data[ 'title'] title = cleantitle.get_query(title) hdlr = 's%02de%02d' % (int(data['season']), int( data['episode'])) if 'tvshowtitle' in data else data['year'] query = '%s %s' % (title, hdlr) query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', '', query) url = self.search_link % quote(query) url = urljoin(self.base_link, url) html = client.request(url) html = html.replace(' ', ' ') try: results = client.parseDOM(html, 'table', attrs={'id': 'searchResult'}) except: return sources url2 = url.replace('/1/', '/2/') html2 = client.request(url2) html2 = html2.replace(' ', ' ') try: results += client.parseDOM(html2, 'table', attrs={'id': 'searchResult'}) except: return sources results = ''.join(results) rows = re.findall('<tr(.+?)</tr>', results, re.DOTALL) if rows is None: return sources for entry in rows: try: try: url = 'magnet:%s' % (re.findall( 'a href="magnet:(.+?)"', entry, re.DOTALL)[0]) url = str(client.replaceHTMLCodes(url).split('&tr')[0]) except: continue try: name = re.findall( 'class="detLink" title=".+?">(.+?)</a>', entry, re.DOTALL)[0] name = client.replaceHTMLCodes(name) name = unquote_plus(name).replace(' ', '.').lower() t = name.split(hdlr)[0].replace( data['year'], '').replace('(', '').replace(')', '').replace( '&', 'and').replace('.US.', '.').replace('.us.', '.').lower() if cleantitle.get(t) != cleantitle.get(title): continue except: continue if hdlr not in name: continue quality, info = source_utils.get_release_quality(name, url) try: size = re.findall( '((?:\d+\.\d+|\d+\,\d+|\d+)\s*(?:GB|GiB|MB|MiB))', entry)[-1] dsize, isize = source_utils._size(size) except: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) sources.append({ 'source': 'torrent', 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name }) except: continue return sources except: log_utils.log('tpb_exc', 1) return sources
def sources(self, url, hostDict, hostprDict): sources = [] try: if debrid.status() is False: return sources if url is None: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) query = '%s s%02de%02d' % (data['tvshowtitle'], int(data['season']), int(data['episode']))\ if 'tvshowtitle' in data else '%s %s' % (data['title'], data['year']) query = re.sub(u'(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query).lower() url = urljoin(self.base_link, self.search_link % quote_plus(query)) #r = client.request(url) #r = requests.get(url).content r = cfScraper.get(url).content r = ensure_text(r, errors='replace').replace(' ', ' ') r = client.parseDOM( r, 'div', attrs={'style': 'display:table;width:100%;text-align:left'}) posts = client.parseDOM(r, 'div', attrs={'class': 'one_result'}) #log_utils.log('posts_is: '+str(posts)) for post in posts: links = client.parseDOM(post, 'div', attrs={'class': 'fa fa-magnet'})[0] url = client.parseDOM(links, 'a', ret='href')[0] url = client.replaceHTMLCodes(url).split('&tr=')[0] name = url.split('&dn=')[1] if not query in cleantitle.get_title(name): continue quality, info = source_utils.get_release_quality(name, url) try: size = client.parseDOM(post, 'span', attrs={'class': 'torrent_size'})[0] dsize, isize = source_utils._size(size) except: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) sources.append({ 'source': 'Torrent', 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name }) return sources except: log_utils.log('btdig3 - Exception', 1) return sources
def sources(self, url, hostDict, hostprDict): try: sources = [] if url is None: return sources if debrid.status() is False: return sources hostDict = hostprDict + hostDict data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = data['tvshowtitle'] if 'tvshowtitle' in data else data[ 'title'] title = cleantitle.get_query(title) query = '%s S%02dE%02d' % ( title, int(data['season']), int(data['episode']) ) if 'tvshowtitle' in data else '%s %s' % (title, data['year']) url = self.search_link % quote_plus(query) url = urljoin(self.base_link, url).replace('%3A+', '+') #r = client.request(url) r = cfScraper.get(url).content r = ensure_text(r, errors='replace') posts = client.parseDOM(r, "div", attrs={"class": "postContent"}) items = [] for post in posts: try: p = client.parseDOM(post, "p", attrs={"dir": "ltr"})[1:] for i in p: items.append(i) except: pass try: for item in items: u = client.parseDOM(item, 'a', ret='href') name = re.findall('<strong>(.*?)</strong>', item, re.DOTALL)[0] name = client.replaceHTMLCodes(name) t = re.sub( '(\.|\(|\[|\s)(\d{4}|S\d*E\d*|S\d*|3D)(\.|\)|\]|\s|)(.+|)', '', name) if not cleantitle.get(t) == cleantitle.get(title): continue for url in u: if any(x in url for x in ['.rar', '.zip', '.iso']): continue quality, info = source_utils.get_release_quality( name, url) try: size = re.findall( '((?:\d+\,\d+\.\d+|\d+\.\d+|\d+\,\d+|\d+)\s*(?:GiB|MiB|GB|MB|gb|mb))', item, re.DOTALL)[0] dsize, isize = source_utils._size(size) except: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) valid, host = source_utils.is_host_valid(url, hostDict) if valid: sources.append({ 'source': host, 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name }) except: pass return sources except: log_utils.log('max_rls Exception', 1) return sources
def sources(self, url, hostDict, hostprDict): sources = [] try: if debrid.status() is False: return sources if url is None: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) query = '%s s%02de%02d' % (data['tvshowtitle'], int(data['season']), int(data['episode']))\ if 'tvshowtitle' in data else '%s %s' % (data['title'], data['year']) query = re.sub(u'(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query).lower() url = urljoin(self.base_link, self.search_link % quote_plus(query)) r = client.request(url) #r = cfScraper.get(url).content r = ensure_text(r, errors='replace').strip() posts = client.parseDOM(r, 'table', attrs={ 'class': 'table2', 'cellspacing': '0' })[1] posts = client.parseDOM(posts, 'tr')[1:] for post in posts: links = client.parseDOM(post, 'a', ret='href')[0] links = client.replaceHTMLCodes(links).lstrip('/') hash = links.split('/')[0] name = links.split('/')[1] url = 'magnet:?xt=urn:btih:{}'.format(hash) if not query in cleantitle.get_title(name): continue quality, info = source_utils.get_release_quality(name) try: size = client.parseDOM(post, 'td', attrs={'class': 'tdnormal'})[1] dsize, isize = source_utils._size(size) except: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) sources.append({ 'source': 'Torrent', 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name }) return sources except: log_utils.log('tdl3 - Exception', 1) return sources
def sources(self, url, hostDict, hostprDict): try: sources = [] if url is None: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) title = data['tvshowtitle'] if 'tvshowtitle' in data else data[ 'title'] title = cleantitle.get_query(title) hdlr = 'S%02dE%02d' % (int(data['season']), int( data['episode'])) if 'tvshowtitle' in data else data['year'] query = '%s S%02dE%02d' % ( title, int(data['season']), int(data['episode']) ) if 'tvshowtitle' in data else '%s %s' % (title, data['year']) query = re.sub('(\\\|/| -|:|;|\*|\?|"|<|>|\|)', ' ', query) url = self.search_link % quote_plus(query) url = urljoin(self.base_link, url) html = client.request(url) if html is None: return sources html = html.replace(' ', ' ') try: rows = client.parseDOM(html, 'tr', attrs={'id': 'torrent_latest_torrents'}) except Exception: return sources if rows is None: #log_utils.log('KICKASS - No Torrents In Search Results') return sources for entry in rows: try: try: name = re.findall('class="cellMainLink">(.+?)</a>', entry, re.DOTALL)[0] name = client.replaceHTMLCodes(name) # t = re.sub('(\.|\(|\[|\s)(\d{4}|S\d*E\d*|S\d*|3D)(\.|\)|\]|\s|)(.+|)', '', name, flags=re.I) if not cleantitle.get(title) in cleantitle.get(name): continue except Exception: continue try: y = re.findall( '[\.|\(|\[|\s|\_|\-](S\d+E\d+|S\d+)[\.|\)|\]|\s|\_|\-]', name, re.I)[-1].upper() except BaseException: y = re.findall( '[\.|\(|\[|\s](\d{4}|S\d*E\d*|S\d*)[\.|\)|\]|\s]', name, re.I)[-1].upper() if not y == hdlr: continue try: link = 'magnet%s' % (re.findall( 'url=magnet(.+?)"', entry, re.DOTALL)[0]) link = str( unquote(six.ensure_text(link)).split('&tr')[0]) except Exception: continue quality, info = source_utils.get_release_quality( name, link) try: size = re.findall( '((?:\d+\.\d+|\d+\,\d+|\d+)\s*(?:GB|GiB|MB|MiB))', entry)[-1] dsize, isize = source_utils._size(size) except Exception: dsize, isize = 0.0, '' info.insert(0, isize) info = ' | '.join(info) sources.append({ 'source': 'Torrent', 'quality': quality, 'language': 'en', 'url': link, 'info': info, 'direct': False, 'debridonly': True, 'size': dsize, 'name': name }) except Exception: continue check = [i for i in sources if not i['quality'] == 'CAM'] if check: sources = check return sources except: log_utils.log('kickass_exc', 1) return sources