Spaces:
Running
Running
import gradio as gr | |
import yt_dlp | |
def download_video(url): | |
ydl_opts = { | |
'format': 'best', | |
'outtmpl': 'downloaded_videos/%(title)s.%(ext)s', | |
} | |
with yt_dlp.YoutubeDL(ydl_opts) as ydl: | |
info_dict = ydl.extract_info(url, download=True) | |
video_title = info_dict.get('title', None) | |
return f"Video '{video_title}' downloaded successfully!" | |
iface = gr.Interface( | |
fn=download_video, | |
inputs=gr.Textbox(label="YouTube URL"), | |
outputs=gr.Textbox(label="Download Status"), | |
title = "yt_dlp", | |
description = "This space was made by [Blane187](https://huggingface.co/Blane187). Please credit me if you use this thing :D" | |
) | |
iface.launch() | |