def fetch_film_by_id(filmaster_film): """ Function takes Filmaster movie object, try to fetch movie object using imdb_code from filmaster movie and return tmdb movie object """ try: film = imdb("tt" + filmaster_film.imdb_code) tmdb_film = getMovieInfo(film.getId()) return tmdb_film except Exception, e: logger.exception(e) return False
def fetch_film_by_id(filmaster_film): """ Function takes Filmaster movie object, try to fetch movie object using imdb_code from filmaster movie and return tmdb movie object """ try: film = imdb("tt"+filmaster_film.imdb_code) tmdb_film = getMovieInfo(film.getId()) return tmdb_film except Exception, e: logger.exception(e) return False
def get_movie_urls(self, title, year=None): """ Returns tmdb movie instance instead of url to movie """ try: s = "Fetching: " + title results = tmdb.search(title) for result in results: logger.debug('Trying to fetch synopsis for: %s' % title ) film_to_fetch = result prod_date = film_to_fetch['released'] if prod_date: production_year, month, day = prod_date.split("-") if year == int(production_year): tmdb_film = tmdb.getMovieInfo(film_to_fetch['id']) logger.debug('Found in tmdb: %s' % tmdb_film["name"]) return [{'url': tmdb_film }] except Exception, e: logger.exception(e)
def get_movie_urls(self, title, year=None): """ Returns tmdb movie instance instead of url to movie """ try: s = "Fetching: " + title results = tmdb.search(title) for result in results: logger.debug('Trying to fetch synopsis for: %s' % title) film_to_fetch = result prod_date = film_to_fetch['released'] if prod_date: production_year, month, day = prod_date.split("-") if year == int(production_year): tmdb_film = tmdb.getMovieInfo(film_to_fetch['id']) logger.debug('Found in tmdb: %s' % tmdb_film["name"]) return [{'url': tmdb_film}] except Exception, e: logger.exception(e)