Exemplo n.º 1
0
 def _getAllInfo(self, search_params):
   ret = []
   try:
     source = IMDb("http")
     movie = source.search_movie(str(search_params))
     info = movie_types.MovieInfo(utils.sanitizeString(movie.title or search_params.title), search_params.year)
     ret.append(info)
     info.year = utils.sanitizeString(movie.year or search_params.year)
     info.genres = [utils.sanitizeString(g) for g in movie.genre] or info.genres
   except (AttributeError, pymdb.MovieError) as ex:
     utils.logWarning("Lib: {} Title: {} Error {}: {}".format(self.display_name, search_params.title, type(ex), ex),
                      title="{} lookup".format(self.display_name))
   return ret
Exemplo n.º 2
0
 def _getAllInfo(self, search_params):
   ret = []
   try:
     source = tvrage.api.Show(search_params.show_name)
     season = source.season(search_params.season_num)
     eps = tv_types.SeasonInfo(utils.sanitizeString(source.name) or search_params.show_name, search_params.season_num)
     ret.append(eps)
     for i in season.values():
       show = tv_types.EpisodeInfo(int(i.number), utils.sanitizeString(i.title))
       eps.episodes.append(show)
   except tvrage.exceptions.BaseError as ex:
     utils.logWarning("Lib: {} Show: {} season_num: {} Error {}: {}".format(self.display_name, search_params.show_name,
                                                                           search_params.season_num, type(ex), ex),
                      title="{} lookup".format(self.display_name))
   return ret
Exemplo n.º 3
0
 def _getAllInfo(self, search_params):
   ret  = []
   info = None
   try:
     movie = pymdb.Movie(str(search_params))
     title = utils.sanitizeString(movie.title or search_params.title)
     info = movie_types.MovieInfo(title, search_params.year)
     ret.append(info)
     info.year = utils.sanitizeString(movie.year or search_params.year)
     info.genres = [utils.sanitizeString(g) for g in movie.genre] or info.genres
   except (ValueError, AttributeError) as ex:
     pass
   except pymdb.MovieError as ex:
     utils.logWarning("Lib: {} Title: {} Error {}: {}".format(self.display_name, search_params.title, type(ex), ex),
                      title="{} lookup".format(self.display_name))
   return ret
Exemplo n.º 4
0
 def _getAllInfo(self, search_params):
   ret = []
   try:
     source = tvdb_api.Tvdb()
     season = source[search_params.show_name][search_params.season_num]
     eps = tv_types.SeasonInfo(utils.sanitizeString(source[search_params.show_name]["seriesname"], "") or
                                         search_params.show_name, search_params.season_num)
     ret.append(eps)
     for i in season:
       episode = season[i]
       show = tv_types.EpisodeInfo(int(episode["episodenumber"]),
                                   utils.sanitizeString(episode["episodename"] or ""))
       eps.episodes.append(show)
   except tvdb_exceptions.tvdb_exception as ex:
     utils.logWarning("Lib: {} Show: {} season_num: {} Error {}: {}".format(self.display_name, search_params.show_name,
                                                                           search_params.season_num, type(ex), ex),
                      title="{} lookup".format(self.display_name))
   return ret
Exemplo n.º 5
0
 def _getAllInfo(self, search_params):
   ret = []
   try:
     pretty_title = str(search_params)
     source = tmdb.MovieDb()
     results = source.search(pretty_title)
     for result in results:
       title = utils.sanitizeString(result.get("name", search_params.title))
       year = str(result.get("released", search_params.year))[:4]
       info = movie_types.MovieInfo(title, year)
       ret.append(info)
       sub_info = result.info()
       genres = []
       if "categories" in sub_info and "genre" in sub_info["categories"]:
         genres = sub_info["categories"]["genre"].keys()
       info.genres = [utils.sanitizeString(g) for g in genres]
   except tmdb.TmdBaseError as ex:
     utils.logWarning("Lib: {} Title: {} Error {}: {}".format(self.display_name, search_params.title, type(ex), ex),
                      title="{} lookup".format(self.display_name))
   return ret
Exemplo n.º 6
0
 def _getAllInfo(self, search_params):
   ret = []
   try:
     pretty_title = str(search_params)
     source = RT(self.key)
     results = source.search(pretty_title)
     for i in results:
       title = utils.sanitizeString(i.get("title", search_params.title))
       year = str(i.get("year", search_params.year))
       info = movie_types.MovieInfo(title, year)
       #no genre without more effort
       ret.append(info)
   except Exception as ex: #bad need to find a better exception
     utils.logWarning("Lib: {} Title: {} Error {}: {}".format(self.display_name, search_params.title, type(ex), ex),
                      title="{} lookup".format(self.display_name))
   return ret
Exemplo n.º 7
0
 def getKey(self):
   return self.title if not self.year else utils.sanitizeString("{} ({})".format(self.title, self.year))