Python IMDbPY – 获取该系列的概要
在本文中,我们将了解如何获得该系列的概要。概要。概要是一个简短的摘要,让观众了解作品的内容。它概述了故事情节或要点以及作品的其他定义因素,其中可能包括风格、流派、人物或字符、背景等。
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
下面是实现
# 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)
输出 :
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.”]
另一个例子
# 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)
输出 :
['Season 1A struggling high school chemistry teacher.......search the compound.']