IMDb provides a data dump in tsv format for noncommercial use here: https://www.imdb.com/interfaces/ This script simply downloads the data and imports it into a sqlite database so it can be queried.
Bash
sqlite3
wget
git clone git@github.com:thtroyer/imdb-downloader.git
cd imdb-downloader
./run.sh