def sources(self, url, hostDict, hostprDict): sources = [] try: with requests.Session() as s: if 'episode' in url: link = cleantitle.clean_search_query(url['tvshowtitle']) + ".s" + \ url['season'] + "e" + url['episode'] else: link = cleantitle.clean_search_query("%s.%s") % (url['title'], url['year']) p = s.get(self.search_link + link + "/type/videos") soup = BeautifulSoup(p.text, 'html.parser').find_all('table')[0] soup = soup.find_all('button') for i in soup: fileUrl = i['data-clipboard-text'] source_check = self.link_check(fileUrl.lower(), re.sub('[^0-9a-zA-Z]+', '.', link).lower()) if source_check != False: hoster = fileUrl.split('/')[2] quality = source_utils.check_sd_url(fileUrl) sources.append({ 'source': hoster, 'quality': quality, 'language': 'en', 'url': fileUrl, 'direct': False, 'debridonly': False, 'info':'FilePursuit App Available on the Play Store' }) return sources except: print("Unexpected error in Filepursuit Script: Sources", sys.exc_info()[0]) exc_type, exc_obj, exc_tb = sys.exc_info() print(exc_type, exc_tb.tb_lineno) return sources
def movie(self, imdb, title, localtitle, aliases, year): try: title = cleantitle.clean_search_query(title) url = {'title': title, 'year': year} return url except Exception: return
def tvshow(self, imdb, tvdb, tvshowtitle, localtvshowtitle, aliases, year): url = cleantitle.clean_search_query(tvshowtitle) return url