Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -66,60 +66,61 @@ if latest_ep_button:
|
|
66 |
|
67 |
# Dropdown box
|
68 |
st.sidebar.subheader("Available Podcasts Feeds")
|
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 |
|
|
|
66 |
|
67 |
# Dropdown box
|
68 |
st.sidebar.subheader("Available Podcasts Feeds")
|
69 |
+
|
70 |
+
selected_podcast = st.sidebar.selectbox("Select Podcast", options=podcast_five_titles,index=None,key='podcast_selection')
|
71 |
|
72 |
+
if selected_podcast is not None:
|
73 |
|
74 |
+
if 'podcast_selection' not in st.session_state:
|
75 |
+
st.session_state.podcast_selection = selected_podcast
|
76 |
|
77 |
+
print(selected_podcast)
|
78 |
+
|
79 |
+
st.sidebar.markdown("**Note**: Podcast processing can take upto 5 mins, please be patient.")
|
80 |
+
|
81 |
+
podcast_link = pods[st.session_state.podcast_selection][0]
|
82 |
+
podcast_image = pods[st.session_state.podcast_selection][1]
|
83 |
|
84 |
+
# Right section - Newsletter content
|
85 |
+
st.header("Newsletter Content")
|
86 |
|
87 |
+
# Display the podcast title
|
88 |
+
st.subheader("Episode Title")
|
89 |
+
st.write(selected_podcast)
|
90 |
|
91 |
+
# Display the podcast summary and the cover image in a side-by-side layout
|
92 |
+
col1, col2 = st.columns([7, 3])
|
93 |
|
94 |
+
# Get podcast transcription and info
|
95 |
+
podcast_info = process_podcast(podcast_link)
|
96 |
+
|
97 |
+
with col1:
|
98 |
+
# Display the podcast episode summary
|
99 |
+
st.subheader("Podcast Episode Summary")
|
100 |
+
st.write(podcast_info['podcast_summary'])
|
101 |
+
|
102 |
+
if podcast_image:
|
103 |
+
with col2:
|
104 |
+
st.image(podcast_image, caption="Podcast Cover", width=300, use_column_width=True)
|
105 |
+
|
106 |
+
# Display the podcast guest and their details in a side-by-side layout
|
107 |
+
col3, col4 = st.columns([3, 7])
|
108 |
+
|
109 |
+
with col3:
|
110 |
+
st.subheader("Podcast Guest")
|
111 |
+
st.write(podcast_info['podcast_guest'])
|
112 |
+
|
113 |
+
with col4:
|
114 |
+
st.subheader("Podcast Guest Details")
|
115 |
+
st.write(podcast_info["podcast_guest_title"])
|
116 |
+
st.write(podcast_info["podcast_guest_org"])
|
117 |
+
|
118 |
+
# Display the five key moments
|
119 |
+
st.subheader("Key Moments")
|
120 |
+
key_moments = podcast_info['podcast_highlights']
|
121 |
+
for moment in key_moments.split('\n'):
|
122 |
+
st.markdown(
|
123 |
+
f"<p style='margin-bottom: 5px;'>{moment}</p>", unsafe_allow_html=True)
|
124 |
|
125 |
|
126 |
|