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()