SheilaDesanze commited on
Commit
0a92340
โ€ข
1 Parent(s): 6edc3fa

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from youtube_extractor import YouTubeExtractor
3
+
4
+ extractor = YouTubeExtractor()
5
+
6
+ def process_youtube_url(youtube_url):
7
+ metadata, best_video_only, best_audio_only, best_combined = extractor.extract_info(youtube_url)
8
+ return extractor.format_output(metadata, best_video_only, best_audio_only, best_combined)
9
+
10
+ with gr.Blocks() as demo:
11
+ gr.Markdown("## YouTube ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ ๋ฐ ๋‹ค์šด๋กœ๋“œ ๋งํฌ ์ถ”์ถœ๊ธฐ")
12
+ gr.Markdown("์ฃผ์˜: ์ด ๋„๊ตฌ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ €์ž‘๊ถŒ์ด ์žˆ๋Š” ์ฝ˜ํ…์ธ ๋ฅผ ๋ฌด๋‹จ์œผ๋กœ ๋‹ค์šด๋กœ๋“œํ•˜๋Š” ๊ฒƒ์€ ๋ถˆ๋ฒ•์ž…๋‹ˆ๋‹ค.")
13
+
14
+ youtube_url_input = gr.Textbox(label="YouTube URL ์ž…๋ ฅ")
15
+ extract_button = gr.Button("์ •๋ณด ์ถ”์ถœ")
16
+ output = gr.Textbox(label="์ถ”์ถœ๋œ ์ •๋ณด", lines=10)
17
+ download_links = gr.HTML(label="๋‹ค์šด๋กœ๋“œ ๋งํฌ")
18
+
19
+ extract_button.click(
20
+ fn=process_youtube_url,
21
+ inputs=youtube_url_input,
22
+ outputs=[output, download_links]
23
+ )
24
+
25
+ if __name__ == "__main__":
26
+ demo.launch()