Spaces:
Sleeping
Sleeping
File size: 769 Bytes
c90dd55 51d80b2 c90dd55 51d80b2 c90dd55 51d80b2 c90dd55 |
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 30 |
import gradio as gr
import yt_dlp
def download_video(link):
try:
ydl_opts = {
'format': 'best',
'outtmpl': '%(title)s.%(ext)s',
}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
info_dict = ydl.extract_info(link, download=True)
title = info_dict.get('title', 'Video')
return f"{title} başarıyla indirildi!"
except Exception as e:
return f"Hata oluştu: {str(e)}"
# Gradio arayüzü
interface = gr.Interface(
fn=download_video,
inputs=gr.Textbox(label="YouTube Video Linki"),
outputs="text",
title="YouTube Video İndirici",
description="YouTube linkini girin ve videoyu MP4 formatında indirin.",
)
#başlat
interface.launch(share=True)
|