-
Notifications
You must be signed in to change notification settings - Fork 0
/
imdbtest.py
42 lines (37 loc) · 1.1 KB
/
imdbtest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from imdb import IMDb
# create an instance of the IMDb class
ia = IMDb()
# get a movie and print its director(s)
the_matrix = ia.search_movie('Stargate SG1')
for movie in the_matrix:
print(movie["title"])
print(movie.movieID)
mv=ia.get_movie(movie.movieID)
print(mv)
ia.update(mv, 'episodes')
episode = mv['episodes'][4][3]
#print(episode)
print(episode["plot"])
print(episode["title"])
#print(episode["synopsis"])
for key in mv.current_info:
try:
print(mv[key])
except Exception as e:
print("except"+str(e))
pass
print()
"""
for director in the_matrix['directors']:
print(director['name'])
# show all information that are currently available for a movie
print(sorted(the_matrix.keys()))
# show all information sets that can be fetched for a movie
print(ia.get_movie_infoset())
# update a Movie object with more information
ia.update(the_matrix, ['technical'])
# show which keys were added by the information set
print(the_matrix.infoset2keys['technical'])
# print one of the new keys
print(the_matrix.get('tech'))
"""