def smartplay(self, mode='next'): if mode == 'scrape_next_episode': try: if self.content == 'movie': raise Exception() from resources.lib.modules import smartplay smartplay.scrape_next_episode(self.tvshowtitle, self.year, self.imdb, self.tvdb, 'en', season=self.season, episode=self.episode) except: pass elif mode == 'nextup': try: if self.content == 'movie': raise Exception() from resources.lib.modules import smartplay self.next_episode = smartplay.next_episode( self.tvshowtitle, self.year, self.imdb, self.tvdb, 'en', season=self.season, episode=self.episode) self.playNext = nextup.nextup(self.next_episode) except: pass elif mode == 'next_episode': try: from resources.lib.modules import smartplay self.next_episode = smartplay.next_episode( self.tvshowtitle, self.year, self.imdb, self.tvdb, 'en', season=self.season, episode=self.episode) except: pass elif mode == 'inprogress_next_episode': try: from resources.lib.modules import smartplay if len(self.next_episode) < 1: self.next_episode = smartplay.next_episode( self.tvshowtitle, self.year, self.imdb, self.tvdb, 'en', season=self.season, episode=self.episode) self.add_nextup_episode(self.next_episode) except: pass
def nextup_routine(self, mode): try: self.next_episode = self.smartplay(mode='next_episode') self.playNext = nextup.nextup(self.next_episode) except: pass