File size: 695 Bytes
57e8255
c0a1d1d
29ded09
 
 
 
281bdba
29ded09
 
281bdba
863c552
29ded09
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29


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