GilbertClaus commited on
Commit
8069ca7
·
1 Parent(s): d399888

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +42 -19
app.py CHANGED
@@ -1,21 +1,44 @@
1
- import gradio as gr
 
 
2
  from youtube import cut_video
3
 
4
- iface = gr.Interface(
5
- fn=cut_video,
6
- inputs=[
7
- gr.inputs.Textbox(lines=1, label="Link Video"),
8
- gr.inputs.Textbox(lines=1, label="Resolusi", default='720'),
9
- gr.inputs.Textbox(lines=1, label="Start Time (HH:MM:SS.MS)", default='00:00:00.000'),
10
- gr.inputs.Textbox(lines=1, label="End Time (HH:MM:SS.MS)", default='00:01:00.000'),
11
- ],
12
- outputs=[
13
- gr.outputs.Textbox(label="Video Information"),
14
- gr.outputs.Video(label="Hasil Video"),
15
- gr.outputs.File(label="Download Hasil Potongan Video"),
16
- ],
17
- title="YouTube Video Cutter",
18
- description="Potong dan download sebagian video YouTube.",
19
- )
20
-
21
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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()