Spaces:
Paused
Paused
Commit ·
d5aa80a
1
Parent(s): 1132546
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,15 +18,20 @@ if selected == 'Youtube':
|
|
| 18 |
|
| 19 |
if st.button("Download and Cut Video"):
|
| 20 |
video_info, video_result, video_file = cut_video(video_link, resolution, start_time, end_time)
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
text_area_height = 25 * num_lines
|
| 23 |
-
st.text_area("Informasi Video", video_info, height=text_area_height)
|
| 24 |
-
st.video(video_result)
|
| 25 |
-
with open(video_file, 'rb') as f:
|
| 26 |
file_contents = f.read()
|
| 27 |
st.download_button(
|
| 28 |
label="Download Hasil Potongan Video",
|
| 29 |
data=file_contents,
|
| 30 |
-
file_name=video_file.replace('/home/user/app/Hasil Potong', '').title().replace('Mp4', 'mp4'),
|
| 31 |
mime='application/octet-stream'
|
| 32 |
)
|
|
|
|
| 18 |
|
| 19 |
if st.button("Download and Cut Video"):
|
| 20 |
video_info, video_result, video_file = cut_video(video_link, resolution, start_time, end_time)
|
| 21 |
+
st.session_state.video_info = video_info
|
| 22 |
+
st.session_state.video_result = video_result
|
| 23 |
+
st.session_state.video_file = video_file
|
| 24 |
+
|
| 25 |
+
if 'video_info' in st.session_state:
|
| 26 |
+
num_lines = st.session_state.video_info.count('\n') + 1
|
| 27 |
text_area_height = 25 * num_lines
|
| 28 |
+
st.text_area("Informasi Video", st.session_state.video_info, height=text_area_height)
|
| 29 |
+
st.video(st.session_state.video_result)
|
| 30 |
+
with open(st.session_state.video_file, 'rb') as f:
|
| 31 |
file_contents = f.read()
|
| 32 |
st.download_button(
|
| 33 |
label="Download Hasil Potongan Video",
|
| 34 |
data=file_contents,
|
| 35 |
+
file_name=st.session_state.video_file.replace('/home/user/app/Hasil Potong', '').title().replace('Mp4', 'mp4'),
|
| 36 |
mime='application/octet-stream'
|
| 37 |
)
|