-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
31 lines (27 loc) · 1.08 KB
/
main.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
import requests
def movie_info(name):
api_key = "26b4c440"
url = f"http://www.omdbapi.com/?apikey={api_key}&t={name}"
response = requests.get(url)
movie_info_json = response.json()
if movie_info_json["Response"] == "True":
print("Title:", movie_info_json.get("Title"))
print("Year:", movie_info_json.get("Year"))
print("Time:", movie_info_json.get("Runtime"))
print("Genre:", movie_info_json.get("Genre"))
print("Director:", movie_info_json.get("Director"))
print("Writer:", movie_info_json.get("Writer"))
print("Actors:", movie_info_json.get("Actors"))
print("Awards:", movie_info_json.get("Awards"))
print("BoxOffice:", movie_info_json.get("BoxOffice"))
print("Metascore:", movie_info_json.get("Metascore"))
print("IMDB:", movie_info_json.get("imdbRating"))
else:
print("Movie not found!")
print("# Welcome to Movie Info Finder #")
print()
print("Write the Movie Name, Example: Fight Club")
print()
movie_name = input("Movie Name: ")
print("----------")
movie_info(movie_name)