Spaces:
Build error
Build error
Paul Ke commited on
Update streamlit_app.py
Browse files- streamlit_app.py +10 -11
streamlit_app.py
CHANGED
|
@@ -57,7 +57,7 @@ def _remove_all_videos():
|
|
| 57 |
except FileNotFoundError:
|
| 58 |
print("Couldn't delete file:", video)
|
| 59 |
|
| 60 |
-
expander = st.sidebar.expander("Options", expanded=
|
| 61 |
#API KEY
|
| 62 |
API_KEY = expander.text_input("Google API Key", "AIzaSyB2uDj6IeuNszSuk80feW-eBgpIDH0WFSY")
|
| 63 |
if API_KEY:
|
|
@@ -148,16 +148,15 @@ st.sidebar.text_input(
|
|
| 148 |
with st.sidebar.expander("Options", expanded=False):
|
| 149 |
st.text_input("Video Password", key="video-password", placeholder="Enter Video Password")
|
| 150 |
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
st.session_state["videos"] = video_path
|
| 161 |
|
| 162 |
st.sidebar.button(
|
| 163 |
"Clear Videos",
|
|
|
|
| 57 |
except FileNotFoundError:
|
| 58 |
print("Couldn't delete file:", video)
|
| 59 |
|
| 60 |
+
expander = st.sidebar.expander("Options", expanded=True)
|
| 61 |
#API KEY
|
| 62 |
API_KEY = expander.text_input("Google API Key", "AIzaSyB2uDj6IeuNszSuk80feW-eBgpIDH0WFSY")
|
| 63 |
if API_KEY:
|
|
|
|
| 148 |
with st.sidebar.expander("Options", expanded=False):
|
| 149 |
st.text_input("Video Password", key="video-password", placeholder="Enter Video Password")
|
| 150 |
|
| 151 |
+
download = st.sidebar.button("Load Video")
|
| 152 |
+
if download:
|
| 153 |
+
download_options = {}
|
| 154 |
+
if st.session_state["video-password"]:
|
| 155 |
+
download_options["videopassword"] = st.session_state["video-password"]
|
| 156 |
+
video_path = download_video(
|
| 157 |
+
st.session_state["url"], save_path=os.path.join(".", "data"), **download_options
|
| 158 |
+
)
|
| 159 |
+
st.session_state["videos"] = video_path
|
|
|
|
| 160 |
|
| 161 |
st.sidebar.button(
|
| 162 |
"Clear Videos",
|