def __getitem__(self, episode_number): """Get the episode dict by passing it as a dict key.""" if episode_number not in self: raise IndexerEpisodeNotFound( 'Could not find episode {0!r}'.format(episode_number)) else: return dict.__getitem__(self, episode_number)
def aired_on(self, date): """Search and return a list of episodes with the airdates.""" ret = self.search(text_type(date), 'firstaired') if len(ret) == 0: raise IndexerEpisodeNotFound( 'Could not find any episodes that aired on {0}'.format(date)) return ret