HenzHosting's picture
Create app.py
61ee6e3 verified
raw
history blame
613 Bytes
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()