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 plot outline details from the dictionary
下面是实现
# importing the module
import imdb
# creating instance of IMDb
ia = imdb.IMDb()
# id
code = "6077448"
# getting information
series = ia.get_movie(code)
# getting plot outline of the series
outline = series.data['plot outline']
# printing the object i.e name
print(series)
# print the outline
print(outline)
输出 :
Sacred Games
Sartaj Singh, a Mumbai police officer, receives an anonymous phone call from a gangster who threatens to blow up the entire city. Amid the corrupt standards of Indian law enforcement begins a battle between a 'nobody' cop and ruthless gangster who perceives (sometimes) himself to be a God.
另一个例子
# importing the module
import imdb
# creating instance of IMDb
ia = imdb.IMDb()
# id
code = "6473300"
# getting information
series = ia.get_movie(code)
# getting plot outline of the series
outline = series.data['plot outline']
# printing the object i.e name
print(series)
# print the outline
print(outline)
输出 :
Mirzapur
The iron-fisted Akhandanand Tripathi is a millionaire carpet exporter and the mafia don of Mirzapur. His son, Munna, is an unworthy, power-hungry heir who will stop at nothing to inherit his father’s legacy. An incident at a wedding procession forces him to cross paths with Ramakant Pandit, an upstanding lawyer, and his sons, Guddu and Bablu. It snowballs into a game of ambition, power and greed that threatens the fabric of this lawless city!