Spaces:
Build error
Build error
Paul Ke commited on
Update streamlit_app.py
Browse files- streamlit_app.py +12 -11
streamlit_app.py
CHANGED
|
@@ -163,17 +163,18 @@ if st.session_state["videos"]:
|
|
| 163 |
st.sidebar.video(st.session_state["videos"])
|
| 164 |
except Exception as e:
|
| 165 |
st.write("Couldn't show video")
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
|
|
|
| 177 |
|
| 178 |
# Analysis prompt
|
| 179 |
analysis_prompt = st.sidebar.text_area("Enter analysis")
|
|
|
|
| 163 |
st.sidebar.video(st.session_state["videos"])
|
| 164 |
except Exception as e:
|
| 165 |
st.write("Couldn't show video")
|
| 166 |
+
|
| 167 |
+
try:
|
| 168 |
+
video_file = open(st.session_state["videos"], "rb")
|
| 169 |
+
st.sidebar.download_button(
|
| 170 |
+
"**Download Video π**",
|
| 171 |
+
data=video_file,
|
| 172 |
+
file_name=f"{st.session_state['videos'].lower().translate(str.maketrans('', '', string.punctuation)).replace(' ', '_')}.mp4",
|
| 173 |
+
mime="video/mp4",
|
| 174 |
+
type="primary",
|
| 175 |
+
)
|
| 176 |
+
except Exception as e:
|
| 177 |
+
st.error("Failed downloading the video", icon="π")
|
| 178 |
|
| 179 |
# Analysis prompt
|
| 180 |
analysis_prompt = st.sidebar.text_area("Enter analysis")
|