SheilaDesanze
commited on
Commit
โข
0a92340
1
Parent(s):
6edc3fa
Create app.py
Browse files
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()
|