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): try: sources = [] if url is None: return sources if debrid.status() is False: raise Exception() html = client.request(url) link = re.findall('href="(magnet:.+?)"', html, re.DOTALL) for link in link: link = str(client.replaceHTMLCodes(link).split('&tr')[0]) quality, info = source_utils.get_release_quality(link, link) try: size = re.findall('((?:\d+\.\d+|\d+\,\d+|\d+)\s*(?:GB|GiB|MB|MiB))', html)[-1] div = 1 if size.endswith(('GB', 'GiB')) else 1024 size = float(re.sub('[^0-9|/.|/,]', '', size)) / div size = '%.2f GB' % size info.append(size) except: pass info = ' | '.join(info) sources.append({'source': 'Torrent', 'quality': quality, 'language': 'en', 'url': link, 'info': info, 'direct': False, 'debridonly': True}) return sources except: return sources
def strip_domain(url): try: url = six.ensure_str(url) if url.lower().startswith('http') or url.startswith('/'): url = re.findall('(?://.+?|)(/.+)', url)[0] url = client.replaceHTMLCodes(url) return url except: return
def sources(self, url, hostDict, hostprDict): sources = [] try: if url == None: return sources data = parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) aliases = eval(data['aliases']) if 'tvshowtitle' in data: ep = data['episode'] url = '%s/film/%s-season-%01d/watching.html?ep=%s' % (self.base_link, cleantitle.geturl(data['tvshowtitle']), int(data['season']), ep) r = client.request(url, timeout='10', output='geturl') if url == None: url = self.searchShow(data['tvshowtitle'], data['season'], aliases) else: url = self.searchMovie(data['title'], data['year'], aliases) if url == None: raise Exception() r = cfScraper.get(url).content r = ensure_text(r, errors='ignore') r = client.parseDOM(r, 'div', attrs={'class': 'les-content'}) if 'tvshowtitle' in data: ep = data['episode'] links = client.parseDOM(r, 'a', attrs={'episode-data': ep}, ret='player-data') else: links = client.parseDOM(r, 'a', ret='player-data') for link in links: try: if link.startswith('//'): link = 'https:' + link host = re.findall('([\w]+[.][\w]+)$', urlparse(link.strip().lower()).netloc)[0] if not host in hostDict: raise Exception() host = client.replaceHTMLCodes(host) host = host.encode('utf-8') if 'load.php' not in link: sources.append({'source': host, 'quality': '720p', 'language': 'en', 'url': link, 'direct': False, 'debridonly': False}) except: pass return sources except: log_utils.log('123movies0 exception', 1) return sources
def getTVShowTranslation(self, thetvdb, lang): try: url = 'https://thetvdb.com/api/%s/series/%s/%s.xml' % ( base64.b64decode( 'NWNjMzg0Y2EtODFhOS00NTIyLWJkNzMtZjllZTVjYjBlMWE2'), thetvdb, lang) r = requests.get(url, timeout=15, verify=True).content title = client.parseDOM(r, 'SeriesName')[0] title = client.replaceHTMLCodes(title) title = six.ensure_str(title) return title except: pass
def parse(url): try: url = client.replaceHTMLCodes(url) except: pass try: url = urllib_parse.parse_qs(urllib_parse.urlparse(url).query)['u'][0] except: pass try: url = urllib_parse.parse_qs(urllib_parse.urlparse(url).query)['q'][0] except: pass return url
def check_url(url): try: url = client.replaceHTMLCodes(url) url = urllib_parse.unquote(url) url = re.sub('[^A-Za-z0-9]+', ' ', url) url = six.ensure_str(url) url = url.lower() except: url = str(url) try: quality = get_qual(url) if not quality: quality = 'sd' return quality except: return 'sd'
def _get_sources(self, url): try: item = client.request(url[0]) title = url[1] links = dom_parser2.parse_dom(item, 'a', req='href') links = [i.attrs['href'] for i in links] info = [] try: size = re.findall( '((?:\d+\.\d+|\d+\,\d+|\d+)\s*(?:GiB|MiB|GB|MB))', item)[0] div = 1 if size.endswith(('GB', 'GiB')) else 1024 size = float(re.sub('[^0-9|/.|/,]', '', size)) / div size = '%.2f GB' % size info.insert(0, size) except Exception: pass info = ' | '.join(info) for url in links: if 'youtube' in url: continue if any(x in url.lower() for x in ['.rar.', '.zip.', '.iso.']) or any( url.lower().endswith(x) for x in ['.rar', '.zip', '.iso']): raise Exception() if any(x in url.lower() for x in ['youtube', 'sample', 'trailer']): raise Exception() valid, host = source_utils.is_host_valid(url, self.hostDict) if not valid: continue host = client.replaceHTMLCodes(host) quality, info2 = source_utils.get_release_quality(title, url) self._sources.append({ 'source': host, 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': False }) except Exception: pass
def sources(self, url, hostDict, hostprDict): try: sources = [] if url is None: return sources hostDict = hostprDict + hostDict r = client.request(url) links = re.compile( r'''onclick="if \(confirm\('Delete link (.+?)'\)\)''', re.DOTALL).findall(r) links = [x for y, x in enumerate(links) if x not in links[:y]] for i in links: try: url = i url = client.replaceHTMLCodes(url) url = ensure_str(url) host = re.findall('([\w]+[.][\w]+)$', urlparse(url.strip().lower()).netloc)[0] if host not in hostDict: raise Exception() host = ensure_str(host) if 'vev' not in url: sources.append({ 'source': host, 'quality': 'SD', 'language': 'en', 'url': url, 'direct': False, 'debridonly': False }) except Exception: pass return sources except Exception: failure = traceback.format_exc() log_utils.log('SwatchSeries - Exception: \n' + str(failure)) 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 getFileType(url): try: url = six.ensure_str(url) url = client.replaceHTMLCodes(url) url = urllib_parse.unquote(url) url = url.lower() url = re.sub('[^a-z0-9 ]+', ' ', url) except: url = str(url) type = '' if any(i in url for i in [' bluray ', ' blu ray ']): type += ' BLURAY /' if any(i in url for i in [' bd r ', ' bdr ', ' bd rip ', ' bdrip ', ' br rip ', ' brrip ']): type += ' BD-RIP /' if ' remux ' in url: type += ' REMUX /' if any(i in url for i in [' dvdrip ', ' dvd rip ']): type += ' DVD-RIP /' if any(i in url for i in [' dvd ', ' dvdr ', ' dvd r ']): type += ' DVD /' if any(i in url for i in [' webdl ', ' web dl ', ' web ', ' web rip ', ' webrip ']): type += ' WEB /' if ' hdtv ' in url: type += ' HDTV /' if ' sdtv ' in url: type += ' SDTV /' if any(i in url for i in [' hdrip ', ' hd rip ']): type += ' HDRIP /' if any(i in url for i in [' uhdrip ', ' uhd rip ']): type += ' UHDRIP /' if ' r5 ' in url: type += ' R5 /' if any(i in url for i in [' cam ', ' hdcam ', ' hd cam ', ' cam rip ', ' camrip ']): type += ' CAM /' if any(i in url for i in [' ts ', ' telesync ', ' hdts ', ' pdvd ']): type += ' TS /' if any(i in url for i in [' tc ', ' telecine ', ' hdtc ']): type += ' TC /' if any(i in url for i in [' scr ', ' screener ', ' dvdscr ', ' dvd scr ']): type += ' SCR /' if ' xvid ' in url: type += ' XVID /' if ' avi' in url: type += ' AVI /' if any(i in url for i in [' h 264 ', ' h264 ', ' x264 ', ' avc ']): type += ' H.264 /' if any(i in url for i in [' h 265 ', ' h256 ', ' x265 ', ' hevc ']): type += ' HEVC /' if ' hi10p ' in url: type += ' HI10P /' if ' 10bit ' in url: type += ' 10BIT /' if ' 3d ' in url: type += ' 3D /' if any(i in url for i in [' hdr ', ' hdr10 ', ' dolby vision ', ' hlg ']): type += ' HDR /' if ' imax ' in url: type += ' IMAX /' if any(i in url for i in [' ac3 ', ' ac 3 ']): type += ' AC3 /' if ' aac ' in url: type += ' AAC /' if ' aac5 1 ' in url: type += ' AAC / 5.1 /' if any(i in url for i in [' dd ', ' dolby ', ' dolbydigital ', ' dolby digital ']): type += ' DD /' if any(i in url for i in [' truehd ', ' true hd ']): type += ' TRUEHD /' if ' atmos ' in url: type += ' ATMOS /' if any(i in url for i in [' ddplus ', ' dd plus ', ' ddp ', ' eac3 ', ' eac 3 ']): type += ' DD+ /' if ' dts ' in url: type += ' DTS /' if any(i in url for i in [' hdma ', ' hd ma ']): type += ' HD.MA /' if any(i in url for i in [' hdhra ', ' hd hra ']): type += ' HD.HRA /' if any(i in url for i in [' dtsx ', ' dts x ']): type += ' DTS:X /' if ' dd5 1 ' in url: type += ' DD / 5.1 /' if ' ddp5 1 ' in url: type += ' DD+ / 5.1 /' if any(i in url for i in [' 5 1 ', ' 6ch ']): type += ' 5.1 /' if any(i in url for i in [' 7 1 ', ' 8ch ']): type += ' 7.1 /' if ' korsub ' in url: type += ' HC-SUBS /' if any(i in url for i in [' subs ', ' subbed ', ' sub ']): type += ' SUBS /' if any(i in url for i in [' dub ', ' dubbed ', ' dublado ']): type += ' DUB /' if ' repack ' in url: type += ' REPACK /' if ' proper ' in url: type += ' PROPER /' if ' nuked ' in url: type += ' NUKED /' type = type.rstrip('/') return type
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 resolve(regex): try: vanilla = re.compile('(<regex>.+)', re.MULTILINE | re.DOTALL).findall(regex)[0] cddata = re.compile('<\!\[CDATA\[(.+?)\]\]>', re.MULTILINE | re.DOTALL).findall(regex) for i in cddata: regex = regex.replace('<![CDATA[' + i + ']]>', urllib_parse.quote_plus(i)) regexs = re.compile('(<regex>.+)', re.MULTILINE | re.DOTALL).findall(regex)[0] regexs = re.compile('<regex>(.+?)</regex>', re.MULTILINE | re.DOTALL).findall(regexs) regexs = [ re.compile('<(.+?)>(.*?)</.+?>', re.MULTILINE | re.DOTALL).findall(i) for i in regexs ] regexs = [ dict([(client.replaceHTMLCodes(x[0]), client.replaceHTMLCodes(urllib_parse.unquote_plus(x[1]))) for x in i]) for i in regexs ] regexs = [(i['name'], i) for i in regexs] regexs = dict(regexs) url = regex.split('<regex>', 1)[0].strip() url = client.replaceHTMLCodes(url) url = six.ensure_str(url) r = getRegexParsed(regexs, url) try: ln = '' ret = r[1] listrepeat = r[2]['listrepeat'] regexname = r[2]['name'] for obj in ret: try: item = listrepeat for i in list(range(len(obj) + 1)): item = item.replace( '[%s.param%s]' % (regexname, str(i)), obj[i - 1]) item2 = vanilla for i in list(range(len(obj) + 1)): item2 = item2.replace( '[%s.param%s]' % (regexname, str(i)), obj[i - 1]) item2 = re.compile('(<regex>.+?</regex>)', re.MULTILINE | re.DOTALL).findall(item2) item2 = [ x for x in item2 if not '<name>%s</name>' % regexname in x ] item2 = ''.join(item2) ln += '\n<item>%s\n%s</item>\n' % (item, item2) except: pass return ln except: pass if r[1] == True: return r[0] except: return
def sources(self, url, hostDict, hostprDict): try: sources = [] if url is None: return sources host_dict = 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'] if 'season' in data: season = data['season'] if 'episode' in data: episode = data['episode'] year = data['year'] r = client.request(self.base_link, output='extended', timeout='10') #r = cfScraper.get(self.base_link).content cookie = r[3] headers = r[2] result = r[0] headers['Cookie'] = cookie query = urljoin( self.base_link, self.search_link % quote_plus(cleantitle.getsearch(title))) query2 = urljoin(self.base_link, self.search_link % quote_plus(title).lower()) r = client.request(query, headers=headers, XHR=True) if len(r) < 20: r = client.request(query2, headers=headers, XHR=True) r = json.loads(r)['content'] r = zip(client.parseDOM(r, 'a', ret='href'), client.parseDOM(r, 'a')) if 'tvshowtitle' in data: cltitle = cleantitle.get(title + 'season' + season) cltitle2 = cleantitle.get(title + 'season%02d' % int(season)) r = [ i for i in r if cltitle == cleantitle.get(i[1]) or cltitle2 == cleantitle.get(i[1]) ] vurl = '%s%s-episode-%s' % (self.base_link, str( r[0][0]).replace('/info', ''), episode) vurl2 = None else: cltitle = cleantitle.getsearch(title) cltitle2 = cleantitle.getsearch('%s (%s)' % (title, year)) r = [ i for i in r if cltitle2 == cleantitle.getsearch(i[1]) or cltitle == cleantitle.getsearch(i[1]) ] vurl = '%s%s-episode-0' % (self.base_link, str( r[0][0]).replace('/info', '')) vurl2 = '%s%s-episode-1' % (self.base_link, str( r[0][0]).replace('/info', '')) r = client.request(vurl, headers=headers) headers['Referer'] = vurl slinks = client.parseDOM(r, 'div', attrs={'class': 'anime_muti_link'}) slinks = client.parseDOM(slinks, 'li', ret='data-video') if len(slinks) == 0 and vurl2 is not None: r = client.request(vurl2, headers=headers) headers['Referer'] = vurl2 slinks = client.parseDOM(r, 'div', attrs={'class': 'anime_muti_link'}) slinks = client.parseDOM(slinks, 'li', ret='data-video') slinks = [ slink if slink.startswith('http') else 'https:{0}'.format(slink) for slink in slinks ] for url in slinks: url = client.replaceHTMLCodes(url) #url = url.encode('utf-8') valid, host = source_utils.is_host_valid(url, host_dict) if valid: sources.append({ 'source': host, 'quality': '720p', 'language': 'en', 'url': url, 'direct': False, 'debridonly': False }) return sources except: log_utils.log('gowatchseries3 - 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 = 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): 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 url is None: return sources if debrid.status() is False: return sources hostDict = hostprDict + hostDict data = urlparse.parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) ref_url = url = data['url'] # log_utils.log('url = %s' % url, log_utils.LOGDEBUG) 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'] _headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/72.0' } r = client.request(url, headers=_headers) posts = client.parseDOM(r, 'h2', attrs={'class': 'title'}) posts = zip(client.parseDOM(posts, 'a', ret='title'), client.parseDOM(posts, 'a', ret='href')) if posts == []: return sources for item in posts: try: name = item[0].replace(' ', '.') url = item[1] r = client.request(url, headers=_headers) list = client.parseDOM(r, 'div', attrs={'id': 'content'}) if 'tvshowtitle' in data: regex = '(<strong>(.*?)</strong><br />\s?[A-Z,0-9]*?\s\|\s([A-Z,0-9,\s]*)\|\s((\d+\.\d+|\d*)\s?(?:GB|GiB|Gb|MB|MiB|Mb))?</p>(?:\s<p><a href=\".*?\" .*?_blank\">.*?</a></p>)+)' else: regex = '(<strong>Release Name:</strong>\s*(.*?)<br />\s?<strong>Size:</strong>\s?((\d+\,\d+\.\d+|\d+\.\d+|\d+\,\d+)\s(?:GB|GiB|Gb|MB|MiB|Mb))?<br />(.*\s)*)' for match in re.finditer( regex, list[0].encode('ascii', errors='ignore').decode( 'ascii', errors='ignore').replace(' ', ' ')): name = str(match.group(2)) 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 if 'tvshowtitle' in data: size = str(match.group(4)) else: size = str(match.group(3)) links = client.parseDOM( match.group(1), 'a', attrs={'class': 'autohyperlink'}, ret='href') for url in links: try: if any(x in url for x in ['.rar', '.zip', '.iso', '.sample.']): continue if url in str(sources): continue valid, host = source_utils.is_host_valid( url, hostDict) if not valid: continue host = client.replaceHTMLCodes(host) host = host.encode('utf-8') quality, info = source_utils.get_release_quality( name, url) try: div = 1 if size.endswith( ('GB', 'GiB', 'Gb')) else 1024 size = float( re.sub('[^0-9|/.|/,]', '', size.replace(',', '.'))) / div size = '[B]%.2f GB[/B]' % size info.insert(0, size) except: pass info = ' | '.join(info) sources.append({ 'source': host, 'quality': quality, 'language': 'en', 'url': url, 'info': info, 'direct': False, 'debridonly': True }) except: pass except: pass return sources except: 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): 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): 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'] year = data['year'] title = cleantitle.get_query(title) hdlr = 'S%02dE%02d' % (int(data['season']), int( data['episode'])) if 'tvshowtitle' in data else year premDate = '' query = '%s S%02dE%02d' % ( title, int(data['season']), int(data['episode']) ) if 'tvshowtitle' in data else '%s %s' % (title, year) query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', '', query) query = query.replace(" ", "-") _base_link = self.base_link if int( year) >= 2021 else self.old_base_link #url = self.search_link % quote_plus(query) #url = urljoin(_base_link, url) url = _base_link + query r = cfScraper.get(url).content r = ensure_text(r, errors='replace') if r is None and 'tvshowtitle' in data: season = re.search('S(.*?)E', hdlr) season = season.group(1) query = title query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', '', query) query = query + "-S" + season query = query.replace("&", "and") query = query.replace(" ", " ") query = query.replace(" ", "-") url = _base_link + query r = cfScraper.get(url).content r = ensure_text(r, errors='replace') for loopCount in list(range(0, 2)): if loopCount == 1 or (r is None and 'tvshowtitle' in data): #premDate = re.sub('[ \.]', '-', data['premiered']) query = re.sub(r'[\\\\:;*?"<>|/\-\']', '', title) query = query.replace("&", " and ").replace( " ", " ").replace( " ", "-") # throw in extra spaces around & just in case #query = query + "-" + premDate url = _base_link + query url = url.replace('The-Late-Show-with-Stephen-Colbert', 'Stephen-Colbert') r = cfScraper.get(url).content r = ensure_text(r, errors='replace') posts = client.parseDOM(r, "div", attrs={"class": "content"}) #hostDict = hostprDict + hostDict items = [] for post in posts: try: u = client.parseDOM(post, 'a', ret='href') for i in u: try: name = str(i) if hdlr in name.upper(): items.append(name) #elif len(premDate) > 0 and premDate in name.replace(".", "-"): #items.append(name) except: log_utils.log('RLSBB - Exception', 1) pass except: log_utils.log('RLSBB - Exception', 1) pass if len(items) > 0: break seen_urls = set() for item in items: try: info = [] url = str(item) url = client.replaceHTMLCodes(url) url = ensure_text(url) if url in seen_urls: continue seen_urls.add(url) host = url.replace("\\", "") host2 = host.strip('"') host = re.findall('([\w]+[.][\w]+)$', urlparse( host2.strip().lower()).netloc)[0] if host not in hostDict: continue if any(x in host2 for x in ['.rar', '.zip', '.iso', '.part']): continue quality, info = source_utils.get_release_quality(host2) #try: # size = re.findall('((?:\d+\,\d+\.\d+|\d+\.\d+|\d+\,\d+|\d+)\s*(?:GiB|MiB|GB|MB))', post)[0] # div = 1 if size.endswith(('GB', 'GiB')) else 1024 # size = float(re.sub('[^0-9|/.|/,]', '', size.replace(',', '.'))) / div # size = '%.2f GB' % size # info.append(size) #except: # pass info = ' | '.join(info) host = client.replaceHTMLCodes(host) host = ensure_text(host) sources.append({ 'source': host, 'quality': quality, 'language': 'en', 'url': host2, 'info': info, 'direct': False, 'debridonly': True }) except: log_utils.log('RLSBB - Exception', 1) pass check = [i for i in sources if not i['quality'] == 'CAM'] if check: sources = check return sources except: log_utils.log('RLSBB - Exception', 1) return sources
def sources(self, url, hostDict, hostprDict): sources = [] try: if url == 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'] year = data['year'] hdlr = 's%02de%02d' % (int(data['season']), int( data['episode'])) if 'tvshowtitle' in data else year query = '%s %s' % (title, year) query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query) query = quote_plus(query) url = urljoin(self.base_link, self.search_link % query) r = client.request(url) posts = client.parseDOM(r, 'item') for post in posts: try: name = client.parseDOM(post, 'title')[0] name = client.replaceHTMLCodes(name) name = ensure_str(name, errors='ignore') y = re.findall('(\d{4}|S\d+E\d+|S\d+)', name, re.I)[0] t = re.sub( '(\.|\(|\[|\s)(\d{4}|S\d+E\d+|S\d+|3D)(\.|\)|\]|\s|)(.+|)', '', name, re.I) if not (re.findall('\w+', cleantitle.get(t))[0] == cleantitle.get(title) and year == y): raise Exception() if not 'tvshowtitle' in data: links = client.parseDOM(post, 'a', ret='href') else: ep = '%02d' % int(data['episode']) pattern = '>Season[\s|\:]%d<(.+?)(?:<b>Season|</content)' % int( data['season']) data = re.findall(pattern, post, re.S | re.I) data = dom_parser2.parse_dom(data, 'a', req='href') links = [(i.attrs['href'], i.content.lower()) for i in data] links = [ i[0] for i in links if (hdlr in i[0] or hdlr in i[1] or ep == i[1]) ] for url in links: try: if any(x in url for x in [ '.online', 'xrysoi.', 'filmer', '.bp', '.blogger' ]): continue url = client.replaceHTMLCodes(url) valid, host = source_utils.is_host_valid( url, hostDict) #if 'hdvid' in host: valid = True if not valid: continue # try: dub = re.findall('ΜΕΤΑΓΛΩΤΙΣΜΕΝΟ', post, re.S|re.I)[0] # except: dub = None # info = ' / '.join((name, 'DUB')) if dub else name sources.append({ 'source': host, 'quality': 'sd', 'language': 'gr', 'url': url, 'direct': False, 'debridonly': False }) except: pass except: log_utils.log('xrysoi_exc', 1) pass return sources except: 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): sources = [] try: if url is None: 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) hdlr = 'S%02dE%02d' % (int(data['season']), int(data['episode'])) if 'tvshowtitle' in data else data['year'] query = '%s season %d' % (title, int(data['season'])) if 'tvshowtitle' in data else title query = re.sub('(\\\|/| -|:|;|\*|\?|"|\'|<|>|\|)', ' ', query) query = quote_plus(query) url = urljoin(self.base_link, self.search_link % query) ua = {'User-Agent': client.agent()} r = cfScraper.get(url, headers=ua).content r = six.ensure_text(r, errors='replace') _posts = client.parseDOM(r, 'div', attrs={'class': 'item'}) posts = [] for p in _posts: try: post = (client.parseDOM(p, 'a', ret='href')[1], client.parseDOM(p, 'a')[1], re.findall(r'Release:\s*?(\d{4})</', p, re.I|re.S)[1]) posts.append(post) except: pass posts = [(i[0], client.parseDOM(i[1], 'i')[0], i[2]) for i in posts if i] if 'tvshowtitle' in data: sep = 'season %d' % int(data['season']) sepi = 'season-%1d/episode-%1d.html' % (int(data['season']), int(data['episode'])) post = [i[0] for i in posts if sep in i[1].lower()][0] data = cfScraper.get(post, headers=ua).content data = six.ensure_text(data, errors='replace') link = client.parseDOM(data, 'a', ret='href') link = [i for i in link if sepi in i][0] else: link = [i[0] for i in posts if cleantitle.get_title(title) in cleantitle.get_title(i[1]) and hdlr == i[2]][0] r = cfScraper.get(link, headers=ua).content r = six.ensure_text(r, errors='replace') try: v = re.findall('document.write\(Base64.decode\("(.+?)"\)', r)[0] v = v.encode('utf-8') b64 = base64.b64decode(v) b64 = six.ensure_text(b64, errors='ignore') url = client.parseDOM(b64, 'iframe', ret='src')[0] try: host = re.findall('([\w]+[.][\w]+)$', urlparse(url.strip().lower()).netloc)[0] host = client.replaceHTMLCodes(host) host = six.ensure_str(host) valid, hoster = source_utils.is_host_valid(host, hostDict) if valid: sources.append({ 'source': hoster, 'quality': 'SD', 'language': 'en', 'url': url.replace('\/', '/'), 'direct': False, 'debridonly': False }) except: log_utils.log('plockers4 Exception', 1) pass except: log_utils.log('plockers3 Exception', 1) pass r = client.parseDOM(r, 'div', {'class': 'server_line'}) r = [(client.parseDOM(i, 'a', ret='href')[0], client.parseDOM(i, 'p', attrs={'class': 'server_servername'})[0]) for i in r] if r: for i in r: try: host = re.sub('Server|Link\s*\d+', '', i[1]).lower() url = i[0].replace('\/', '/') host = client.replaceHTMLCodes(host) host = six.ensure_str(host) if 'other' in host: continue valid, hoster = source_utils.is_host_valid(host, hostDict) if valid: sources.append({ 'source': hoster, 'quality': 'SD', 'language': 'en', 'url': url, 'direct': False, 'debridonly': False }) except: log_utils.log('plockers5 Exception', 1) pass return sources except: log_utils.log('plockers Exception', 1) return
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): 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): 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): sources = [] try: if url is None: return data = parse_qs(url) data = dict((i, data[i][0]) for i in data) title = data['title'] year = data['year'] tit = cleantitle.geturl(title + ' ' + year) query = urljoin(self.base_link, tit) r = client.request(query, referer=self.base_link, redirect=True) if not data['imdb'] in r: return sources links = [] try: down = client.parseDOM(r, 'div', attrs={'id': 'tab-download'})[0] down = client.parseDOM(down, 'a', ret='href')[0] data = client.request(down) frames = client.parseDOM(data, 'div', attrs={'class': 'single-link'}) frames = [ client.parseDOM(i, 'a', ret='href')[0] for i in frames if i ] for i in frames: links.append(i) except Exception: pass try: streams = client.parseDOM(r, 'div', attrs={'id': 'tab-stream'})[0] streams = re.findall(r'''iframe src=(.+?) frameborder''', streams.replace('"', ''), re.I | re.DOTALL) for i in streams: links.append(i) except Exception: pass for url in links: try: valid, host = source_utils.is_host_valid(url, hostDict) if not valid: valid, host = source_utils.is_host_valid( url, hostprDict) if not valid: continue else: rd = True else: rd = False #quality, _ = source_utils.get_release_quality(url, url) quality = '720p' host = client.replaceHTMLCodes(host) host = ensure_text(host) if rd: sources.append({ 'source': host, 'quality': quality, 'language': 'en', 'url': url, 'direct': False, 'debridonly': True }) else: sources.append({ 'source': host, 'quality': quality, 'language': 'en', 'url': url, 'direct': False, 'debridonly': False }) except Exception: pass return sources except: log_utils.log('filmxy', 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