SheilaDesanze's picture
Update app.py
b92d77f verified
raw
history blame
883 Bytes
import gradio as gr
from youtube_extractor import YouTubeExtractor
extractor = YouTubeExtractor()
def process_youtube_url(youtube_url):
metadata, best_video_only, best_audio_only, best_combined = extractor.extract_info(youtube_url)
return extractor.format_output(metadata, best_video_only, best_audio_only, best_combined)
with gr.Blocks() as demo:
gr.Markdown("## Extractor de video y audio por separado de YouTube")
youtube_url_input = gr.Textbox(label="Ingrese la URL de YouTube")
extract_button = gr.Button("Extracci贸n de informaci贸n")
output = gr.Textbox(label="Informaci贸n extra铆da", lines=10)
download_links = gr.HTML(label="Enlaces de descarga:")
extract_button.click(
fn=process_youtube_url,
inputs=youtube_url_input,
outputs=[output, download_links]
)
if __name__ == "__main__":
demo.launch()