def movie(self, imdb, title, localtitle, aliases, year): try: url = self.__search( [title, localtitle, anilist.getAlternativTitle(title)] + source_utils.aliases_to_array(aliases), year) return urllib.urlencode({'url': url}) if url else None except: return
def movie(self, imdb, title, localtitle, aliases, year): try: url = self.__search([localtitle] + source_utils.aliases_to_array(aliases), year) if not url and title != localtitle: url = self.__search([title] + source_utils.aliases_to_array(aliases), year) if not url and source_utils.is_anime('movie', 'imdb', imdb): url = self.__search( [anilist.getAlternativTitle(title)] + source_utils.aliases_to_array(aliases), year) return url except: return
def movie(self, imdb, title, localtitle, aliases, year): try: alt_title = anilist.getAlternativTitle(title) aliases = source_utils.aliases_to_array(aliases) url = self.__search([alt_title] + aliases, year, 'movie') if not url and localtitle != alt_title: url = self.__search([localtitle] + aliases, year, 'movie') if not url and title != localtitle: url = self.__search([title] + aliases, year, 'movie') return urllib.urlencode({'url': url, 'episode': '1'}) if url else None except: return
def tvshow(self, imdb, tvdb, tvshowtitle, localtvshowtitle, aliases, year): try: alt_title = anilist.getAlternativTitle(tvshowtitle) aliases = source_utils.aliases_to_array(aliases) url = self.__search([alt_title] + aliases, year, 'animeseries') if not url and localtvshowtitle != alt_title: url = self.__search([localtvshowtitle] + aliases, year, 'animeseries') if not url and tvshowtitle != localtvshowtitle: url = self.__search([tvshowtitle] + aliases, year, 'animeseries') return url except: return
def sources(self, url, hostDict, hostprDict): sources = [] try: if not url: return sources data = urlparse.parse_qs(url) data = dict([(i, data[i][0]) if data[i] else (i, '') for i in data]) tvshowtitle = data.get('tvshowtitle') localtvshowtitle = data.get('localtvshowtitle') aliases = source_utils.aliases_to_array(eval(data['aliases'])) episode = tvmaze.tvMaze().episodeAbsoluteNumber( data.get('tvdb'), int(data.get('season')), int(data.get('episode'))) alt_title = anilist.getAlternativTitle(tvshowtitle) links = self.__search([alt_title] + aliases, episode) if not links and localtvshowtitle != alt_title: links = self.__search([localtvshowtitle] + aliases, episode) if not links and tvshowtitle != localtvshowtitle: links = self.__search([tvshowtitle] + aliases, episode) for link in links: valid, host = source_utils.is_host_valid(link, hostDict) if not valid: continue sources.append({ 'source': host, 'quality': 'SD', 'language': 'de', 'url': link, 'direct': False, 'debridonly': False }) return sources except: return sources