all repos — auto-movie-tagger @ 3beb82d8077da66f915880acff810a57fd2068a8

A Python script that auto tags and adds poster to mkv or mp4 movie files.

[Closes #6] Check if plot outline exists
Prithu Goswami prithugoswami524@gmail.com
Wed, 21 Feb 2018 20:51:20 +0530
commit

3beb82d8077da66f915880acff810a57fd2068a8

parent

8805bee6a0cf05e9be038ea86e3c34c5c771978f

1 files changed, 8 insertions(+), 2 deletions(-)

jump to
M amt.pyamt.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