This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 214
Automated movies and TV series search #324
Open
harsh7x18
wants to merge
1
commit into
powerexploit:master
Choose a base branch
from
harsh7x18:imdb
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+67
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#IT IS A MINI-IMDB PROJECT THAT PROVIDES INFORMATION ABOUT ANY MOVIE OR TV SERIES WHEN SEARCHED. | ||
|
||
#READ THE DOCUMENTATION FIRST, THEN MOVE ON TO THE SOURCE CODE AS DOCUMENTATION WILL BRIEF YOU ABOUT THE PYTHON MODULE, DATA STRUCTURES USED AND ALSO HOW TO WORK THROUGH THIS PROGRAM. | ||
|
||
"""For running this code you have to download IMDbPy package from google. IMDbPY is a Python package useful to retrieve and manage the data of the IMDb movie database about movies, people, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docstrings should ideally be like this:- |
||
characters and companies.Platform-independent and written in Python 3 it can retrieve data from both the IMDb’s web server and a local copy of the whole database. | ||
IMDbPY package can be very easily used by programmers and developers to provide access to the IMDb’s data to their programs.""" | ||
|
||
#For understanding this project you need to have a basic knowledge about python, definition of database, module, instances and lists. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This feels unnecessary. |
||
|
||
"""While running the code it asks for a movie or tv series name. After you enter the movie or a tv series name it returns a list of movies or tv series with its id which are related to the | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please fix Docstring format. |
||
movies or tv series you entered. Since every movie or tv series has a unique id, this program asks for a id for the particular movie or tv series you want to search after you enter the id | ||
it reuturns plot, cast name, director of movie or writer of a tv series, rating, genre. """ | ||
|
||
|
||
import imdb # importing the module | ||
ia = imdb.IMDb() # creating instance of IMDB | ||
print("=======================") | ||
name = input("Enter movie, tv series name : ") # movie name | ||
search = ia.search_movie(name) # searching the movie | ||
lst = list() # defining a list | ||
lst1 = list() | ||
lst2 = list() | ||
for j in range(len(search)) : | ||
id = search[j].movieID | ||
lst1.append(search[j]["title"] + " : " + id) | ||
lst2.append(id) | ||
print(lst1) | ||
print("====================================") | ||
print("As there might me many unwanted results. Please select the movie you want the plot of") | ||
print("\n") | ||
movie = input("Enter the id of the movie or tv series whose plot you want : ") | ||
index = lst2.index(movie) | ||
Movie = search[index] | ||
ia.update(Movie, info = ["plot"]) # to get the plot of the movie | ||
print(Movie["plot"]) | ||
print("\n") | ||
print("Cast of the movie or tv series : ") | ||
movies = ia.get_movie(movie) | ||
cast = movies["cast"] # to get the cast of the movie | ||
for i in cast : | ||
actor = i | ||
print(actor) | ||
print("\n") | ||
print("Director of film or writer of series : ") | ||
try : | ||
for director in movies["directors"] : # try and except is used to prevent error messages that show up while compiling | ||
print(director["name"]) | ||
except : | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please recheck if printing the name of the |
||
for writer in movies["writer"] : | ||
print(writer["name"]) | ||
print("\n") | ||
try : | ||
print("Ratings : ") | ||
rating = movies.data["rating"] | ||
print(rating) | ||
except : | ||
print("Sorry something went wrong, could't get the ratings :(") | ||
print("\n") | ||
try : | ||
print("Genres : ") | ||
genre = movies.data["genres"] | ||
print(genre) | ||
except : | ||
print("Sorry something went wrong, could't get the genres :(") | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely coded project. Please try and get the code formatting to PEP8 format for improved readability.