In this article we will see how we can get the synopsis of the series. Synopsis. A synopsis is a brief summary that gives audiences an idea of what a composition is about. It provides an overview of the storyline or main points and other defining factors of the work, which may include style, genre, persons or characters of note, setting, and so on.
In order to get this we have to do the following –
1. Get the series details with the help of get_movie method
2. As this object will act as dictionary therefore we have to filter the object
3. Get the main data of object with the help of data method which will return dictionary
4. Get the synopsis from the dictionary
Below is the implementation
# importing the module import imdb # creating instance of IMDb ia = imdb.IMDb() # id code = "6473300" # getting information series = ia.get_movie(code) # getting synopsis of the series synopsis = series.data[ 'synopsis' ] # printing the object i.e name print (series) # print the synopsis print (synopsis) |
Output :
Mirzapur
[“Mirzapur is a tale of trigger-happy gangsters with sharp minds and dry humour, where loyalties change in a flash and cold cash rules. Violence is an everyday occurrence where complete and utter dominance is the goal. Politicians, cops, lawyers, and mafia lords are involved in a complex web of relationships and rivalries.Akhandanand Tripathi, also known as ‘Kaleen Bhaiya’, is a millionaire carpet exporter and the don of the city of Mirzapur, which lies in the hinterland, a lawless belt of Purvanchal in eastern India. Mirzapur is the most coveted seat of power in the region. The ruthless Tripathis have been the unchallenged rulers of Mirzapur since Satyananda Tripathi, Akhandanand’s father, took the reins of the city twenty years ago in a bloody uprising.Munna Tripathi, Akhandanand’s son, is power hungry and will not stop at anything to inherit his father’s legacy, an empire built on illegal gun trade and opium smuggling. But his own father believes him unready for seat.Guddu and Bablu Pandit are the sons of the city’s only righteous and upstanding lawyer and activist, Ramakant Pandit. Guddu and Bablu aspire for a better life, that breaks the drudgery of middle-class living, while Ramakant crusades to take on the mighty Tripathis.An unrelated incident, involving Munna at a wedding procession, ignites a series of events entangling the lives of the Tripathis and the Pandits. This sets off a game of ambition, power, loyalty and greed, eventually threatening the control of the Tripathis’s on Mirzapur.”]
Another example
# importing the module import imdb # creating instance of IMDb ia = imdb.IMDb() # id code = "0903747" # getting information series = ia.get_movie(code) # getting synopsis of the series synopsis = series.data[ 'synopsis' ] # printing the object i.e name print (series) # print the synopsis print (synopsis) |
Output :
['Season 1A struggling high school chemistry teacher.......search the compound.']