Ever obtained a huge collection of Movies and don't know where to start watching? You are at the right place! A Python script that reads movie names from a specified directory and creates a file having IMDb ratings for each movie. The script further sorts the list into ascending/descending order as well.
(Disclaimer : I do not agree that IMDb ratings are the best judge of a movie ;) )
This script scrapes IMDb ratings for each movie and lists them in a file. Here is a non-exhaustive list of movies that I had :
Here is the ratings file that the script produces.
One need not worry about jumbled and messy file names like 'Cinema.Paradiso.1988.1080p.BluRay.x264.anoXmos.mp4', the script takes care of the same.
The Python script uses Beautiful Soup python module. To install it, use
$pip install bs4
The path to the directory containing your movies is passed as a command line argument, along with the option on sorting into ascending or descending order, as shown:
$python3 imdbfinder.py enter_complete_path_to_directory_here order_of_the_list('a'/'A' for Ascending and 'd'/'D' for Descending)
$python3 imdbfinder.py /home/sankalp/Movies a
NOTE Ensure that you are using Python 3 and not Python 2. There may be Unicode-related errors in Python 2.
A big thanks to Apurv Bajaj for writing the sort function and to Shyamal Vaderia for inputs and awesome suggestions! Suggestions for improvement are welcome!