Categories
python

Find taglines for any film at IMDb

Lots of times when I am watching a film, I get curious what the movie taglines are. I look it up at imdb.com, but that isn’t always so smart, as I might end up see more than I should. Who likes spoilers?

That’s why I wrote this simple little script to to to IMDb for me and return with only the taglines:

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
from imdb import IMDb # https://imdbpy.readthedocs.io
import sys
ia = IMDb()
if len(sys.argv) > 1:
movies = ia.search_movie(sys.argv[1])
else:
movies = ia.search_movie(input("Search for a movie: "))
movie = ia.get_movie(movies[0].movieID, info=['main', 'taglines', 'plot'])
try:
print('\nTop match found:', movie.get('title'))
print('Full title:', movie.get('long imdb title'))
print('TV Series or movie:', movie.get('kind').upper())
movie_taglines = movie.get('taglines')
print('The top tagline:', movie_taglines[0])
print('\nOther taglines:\n')
for i in movie_taglines[1:]:
print(' *', i)
print('\nThe movie plot:', movie.get('plot')[0])
except:
print('\nNo taglines found, here is the top plot instead:\n')
print(movie.get('plot')[0])
view raw taglines.py hosted with ❤ by GitHub

Here is a sample run:

By hoyd

Communication adviser at Andøya Space.