Spaces:
Running
Running
from pytube import YouTube | |
import gradio as gr | |
def download_video(video_url): | |
try: | |
yt = YouTube(video_url) | |
video_title = yt.title | |
yt.streams.get_highest_resolution().download() | |
return f"β Downloaded: {video_title}" | |
except Exception as e: | |
return f"β Error: {str(e)}" | |
# Create Gradio interface | |
interface = gr.Interface( | |
fn=download_video, | |
inputs=gr.Textbox(label="Enter YouTube Video URL"), | |
outputs=gr.Textbox(label="Status"), | |
title="YouTube Video Downloader", | |
description="Enter a YouTube URL to download the video." | |
) | |
interface.launch() |