Spaces:
Paused
Paused
Commit ·
8069ca7
1
Parent(s): d399888
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,21 +1,44 @@
|
|
| 1 |
-
import
|
|
|
|
|
|
|
| 2 |
from youtube import cut_video
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
from streamlit_option_menu import option_menu
|
| 3 |
+
import streamlit as st
|
| 4 |
from youtube import cut_video
|
| 5 |
|
| 6 |
+
st.set_page_config(page_title="YouTube Video Cutter", page_icon=":scissors:")
|
| 7 |
+
|
| 8 |
+
st.title("YouTube Video Cutter")
|
| 9 |
+
st.write("Potong dan download sebagian video YouTube.")
|
| 10 |
+
|
| 11 |
+
video_link = st.text_input("Link Video")
|
| 12 |
+
resolution = st.text_input("Resolusi", value='720')
|
| 13 |
+
start_time = st.text_input("Start Time (HH:MM:SS.MS)", value='00:00:00.000')
|
| 14 |
+
end_time = st.text_input("End Time (HH:MM:SS.MS)", value='00:01:00.000')
|
| 15 |
+
|
| 16 |
+
if st.button("Download and Cut Video"):
|
| 17 |
+
video_info, video_result, video_file = cut_video(video_link, resolution, start_time, end_time)
|
| 18 |
+
st.write(video_info)
|
| 19 |
+
st.video(video_result)
|
| 20 |
+
st.download_button(label="Download Hasil Potongan Video", data=video_file, file_name="cut_video.mp4")
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
# import gradio as gr
|
| 25 |
+
# from youtube import cut_video
|
| 26 |
+
|
| 27 |
+
# iface = gr.Interface(
|
| 28 |
+
# fn=cut_video,
|
| 29 |
+
# inputs=[
|
| 30 |
+
# gr.inputs.Textbox(lines=1, label="Link Video"),
|
| 31 |
+
# gr.inputs.Textbox(lines=1, label="Resolusi", default='720'),
|
| 32 |
+
# gr.inputs.Textbox(lines=1, label="Start Time (HH:MM:SS.MS)", default='00:00:00.000'),
|
| 33 |
+
# gr.inputs.Textbox(lines=1, label="End Time (HH:MM:SS.MS)", default='00:01:00.000'),
|
| 34 |
+
# ],
|
| 35 |
+
# outputs=[
|
| 36 |
+
# gr.outputs.Textbox(label="Video Information"),
|
| 37 |
+
# gr.outputs.Video(label="Hasil Video"),
|
| 38 |
+
# gr.outputs.File(label="Download Hasil Potongan Video"),
|
| 39 |
+
# ],
|
| 40 |
+
# title="YouTube Video Cutter",
|
| 41 |
+
# description="Potong dan download sebagian video YouTube.",
|
| 42 |
+
# )
|
| 43 |
+
|
| 44 |
+
# iface.launch()
|