[Closes #6] Check if plot outline exists
Prithu Goswami prithugoswami524@gmail.com
Wed, 21 Feb 2018 20:51:20 +0530
1 files changed,
8 insertions(+),
2 deletions(-)
jump to
M
amt.py
→
amt.py
@@ -143,9 +143,15 @@ imdb_movie_year = imdb_movie['base']['year']
imdb_movie_id = mpr['imdb_id'] - imdb_movie_rating = imdb_movie['ratings']['rating'] - imdb_movie_plot_outline = imdb_movie['plot']['outline']['text'] + + if not 'outline' in imdb_movie['plot']: + imdb_movie_plot_outline = (imdb_movie['plot']['summaries'][0] + ['text']) + print("\nPlot outline does not exist. Fetching plot summary " + "instead.\n\n") + else: + imdb_movie_plot_outline = imdb_movie['plot']['outline']['text'] # Composing a string to have the rating and the plot of the # movie which will go into the 'comment' metadata of the