-
Notifications
You must be signed in to change notification settings - Fork 0
/
movie-ratings.py
201 lines (193 loc) · 8.28 KB
/
movie-ratings.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import streamlit as st
import numpy as np
import pandas as pd
from PIL import Image
import requests
st.sidebar.title("Genres") #NEW - Sidebar menue with buttons
genre_choice = st.sidebar.radio("Select a Genre", ["Comedy", "Thriller", "Horror"])
if genre_choice == "Thriller":
st.title("Personal ratings: Thriller")
check_loved = st.checkbox("Loved Movies") #NEW - checkbox
movies = (["- The Hunger Games: The Ballads of Songbirds and Snakes", "- Oppenheimer"])
images = (["hungergames.jpg", "oppenheimer.jpg"])
links = (["https://youtu.be/NxW_X4kzeus?si=_WJxsU0HO_eqco93", "https://youtu.be/uYPbbksJxIg?si=aW42iKXT9CSgM0YE"])
if check_loved:
for movie, image,link in zip(movies, images,links):
movielist = movie.split()
if len(movielist) > 0:
fullurl = "https://www.omdbapi.com/?t=" + "+".join(movielist[:3]) + "&y=2023&apikey=929a2841"
r = requests.get(fullurl) #API included
data = r.json()
plot = data.get("Plot")
st.write(movie)
st.header("Plot")
expander = st.expander("Plot")
expander.write(plot)
st.link_button("Trailer", link) #NEW - button
st.write(movie)
st.image(image, caption=movie[1:])
st.write("--")
check_liked = st.checkbox("Liked Movies")
movies = (["- Cocaine Bear", "- Spider-Man: Across the Spider-Verse"])
images = (["bear.jpeg", "spider.jpg"])
links = (["https://youtu.be/DuWEEKeJLMI?si=PfBrmNFFB0M5zvOF", "https://youtu.be/shW9i6k8cB0?si=qdJER9iFTybFWK-s"])
if check_liked:
for movie, image,link in zip(movies, images,links):
movielist = movie.split()
if len(movielist) > 0:
fullurl = "https://www.omdbapi.com/?t=" + "+".join(movielist) + "&y=2023&apikey=929a2841"
r = requests.get(fullurl)
data = r.json()
plot = data.get("Plot")
st.write(movie)
st.header("Plot")
expander = st.expander("Plot")
expander.write(plot)
st.link_button("Trailer", link)
st.write(movie)
st.image(image, caption=movie[1:])
st.write("--")
check_dislike = st.checkbox("Disliked Movies")
movies = (["- John Wick: Chapter 4", "- Creed III"])
images = (["4.jpg", "3.jpg"])
links = (["https://youtu.be/qEVUtrk8_B4?si=LQYhB-KCiukc7anh", "https://youtu.be/AHmCH7iB_IM?si=mqr82EeojX-oLqRQ"])
if check_dislike:
for movie, image,link in zip(movies, images,links):
movielist = movie.split()
if len(movielist) > 0:
fullurl = "https://www.omdbapi.com/?t=" + "+".join(movielist) + "&y=2023&apikey=929a2841"
r = requests.get(fullurl)
data = r.json()
plot = data.get("Plot")
st.write(movie)
st.header("Plot")
expander = st.expander("Plot")
expander.write(plot)
st.link_button("Trailer", link)
st.write(movie)
st.image(image, caption=movie[1:])
st.write("--")
if genre_choice == "Comedy":
st.title("Personal ratings: Comedy")
check_loved = st.checkbox("Loved Movies")
movies = (["- Barbie"])
images = (["barbie.jpg"])
links = (["https://youtu.be/pBk4NYhWNMM?si=rJDQKOPabPqoz46t"])
if check_loved:
for movie, image,link in zip(movies, images,links):
movielist = movie.split()
if len(movielist) > 0:
fullurl = "https://www.omdbapi.com/?t=" + "+".join(movielist) + "&y=2023&apikey=929a2841"
r = requests.get(fullurl)
data = r.json()
plot = data.get("Plot")
st.write(movie)
st.header("Plot")
expander = st.expander("Plot")
expander.write(plot)
st.link_button("Trailer", link)
st.write(movie)
st.image(image, caption=movie[1:])
st.write("--")
check_liked = st.checkbox("Liked Movies")
movies = (["- Renfield"])
images = (["vamp.jpg"])
links = (["https://youtu.be/6LmO6rmDW08?si=l6WTI5-MCZPRUuhl"])
if check_liked:
for movie, image,link in zip(movies, images,links):
movielist = movie.split()
if len(movielist) > 0:
fullurl = "https://www.omdbapi.com/?t=" + "+".join(movielist) + "&y=2023&apikey=929a2841"
r = requests.get(fullurl)
data = r.json()
plot = data.get("Plot")
st.write(movie)
st.header("Plot")
expander = st.expander("Plot")
expander.write(plot)
st.link_button("Trailer", link)
st.write(movie)
st.image(image, caption=movie[1:])
st.write("--")
check_disliked = st.checkbox("Disliked Movies")
movies = (["Theater Camp"])
images = (["camp.jpg"])
links = (["https://www.youtube.com/watch?v=puVDIUk0kM8"])
if check_disliked:
for movie, image,link in zip(movies, images,links):
movielist = movie.split()
if len(movielist) > 0:
fullurl = "https://www.omdbapi.com/?t=" + "+".join(movielist) + "&y=2023&apikey=929a2841"
r = requests.get(fullurl)
data = r.json()
plot = data.get("Plot")
st.write(movie)
st.header("Plot")
expander = st.expander("Plot")
expander.write(plot)
st.link_button("Trailer", link)
st.write(movie)
st.image(image, caption=movie[1:])
st.write("--")
if genre_choice == "Horror":
st.title("Personal ratings: Horror")
check_loved = st.checkbox("Loved Movies")
movies = (["- Scream VI"])
images = (["scream.jpg"])
links = (["https://youtu.be/h74AXqw4Opc?si=TtCwxzoGTjIn3GlM"])
if check_loved:
for movie, image,link in zip(movies, images,links):
movielist = movie.split()
if len(movielist) > 0:
fullurl = "https://www.omdbapi.com/?t=" + "+".join(movielist) + "&y=2023&apikey=929a2841"
r = requests.get(fullurl)
data = r.json()
plot = data.get("Plot")
st.write(movie)
st.header("Plot")
expander = st.expander("Plot")
expander.write(plot)
st.link_button("Trailer", link)
st.write(movie)
st.image(image, caption=movie[1:])
st.write("--")
check_liked = st.checkbox("Liked Movies")
movies = (["- Five Nights at Freddy's"])
images = (["five.jpg"])
links = (["https://youtu.be/0VH9WCFV6XQ?si=6S95LK8hmrEaw-6v"])
if check_liked:
for movie, image,link in zip(movies, images,links):
movielist = movie.split()
if len(movielist) > 0:
fullurl = "https://www.omdbapi.com/?t=" + "+".join(movielist) + "&y=2023&apikey=929a2841"
r = requests.get(fullurl)
data = r.json()
plot = data.get("Plot")
st.write(movie)
st.header("Plot")
expander = st.expander("Plot")
expander.write(plot)
st.link_button("Trailer", link)
st.write(movie)
st.image(image, caption=movie[1:])
st.write("--")
check_disliked = st.checkbox("Disliked Movies")
movies = ([" - The Tutor"])
images = (["tutor.jpg"])
links = (["https://www.youtube.com/watch?v=E-x3u1rsu1M"])
if check_disliked:
for movie, image,link in zip(movies, images,links):
movielist = movie.split()
if len(movielist) > 0:
fullurl = "https://www.omdbapi.com/?t=" + "+".join(movielist) + "&y=2023&apikey=929a2841"
r = requests.get(fullurl)
data = r.json()
plot = data.get("Plot")
st.write(movie)
st.header("Plot")
expander = st.expander("Plot")
expander.write(plot)
st.link_button("Trailer", link)
st.write(movie)
st.image(image, caption=movie[1:])
st.write("--")