Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
import yt_dlp
|
2 |
import gradio as gr
|
3 |
|
4 |
-
def
|
5 |
ydl_opts = {
|
6 |
'format': 'bestaudio/best',
|
7 |
'postprocessors': [{
|
@@ -17,12 +17,12 @@ def download_youtube_wav(url, custom_name):
|
|
17 |
|
18 |
return f'Download complete! File saved as: {custom_name}.wav'
|
19 |
|
20 |
-
iface = gr.Interface(
|
21 |
-
fn=download_youtube_wav,
|
22 |
-
inputs=['text', 'text'],
|
23 |
-
outputs=gr.Audio,
|
24 |
-
title='YouTube WAV Downloader',
|
25 |
-
description='Enter the YouTube URL and a custom name for your .wav file.'
|
26 |
-
)
|
27 |
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import yt_dlp
|
2 |
import gradio as gr
|
3 |
|
4 |
+
def Greet(url, custom_name):
|
5 |
ydl_opts = {
|
6 |
'format': 'bestaudio/best',
|
7 |
'postprocessors': [{
|
|
|
17 |
|
18 |
return f'Download complete! File saved as: {custom_name}.wav'
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
+
with gr.Blocks() as demo:
|
22 |
+
url = gr.Textbox(label="url video")
|
23 |
+
custom_name = gr.Textbox(label="custom_name")
|
24 |
+
output = gr.Audio(label="output")
|
25 |
+
greet_btn = gr.Button("Greet")
|
26 |
+
greet_btn.click(fn=greet, inputs=url, custom_name, outputs=output, api_name="greet")
|
27 |
+
|
28 |
+
demo.launch()
|