Doubleupai commited on
Commit
f2117da
·
verified ·
1 Parent(s): 11f4d06

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from pytube import YouTube
3
+
4
+ def download_video(url):
5
+ try:
6
+ yt = YouTube(url)
7
+ stream = yt.streams.get_highest_resolution()
8
+ stream.download()
9
+ return f"Видео '{yt.title}' успешно скачано!"
10
+ except Exception as e:
11
+ return f"Ошибка: {str(e)}"
12
+
13
+ iface = gr.Interface(
14
+ fn=download_video,
15
+ inputs="text",
16
+ outputs="text",
17
+ title="chalukerTOOLS - Скачивание видео с YouTube",
18
+ description="Введите URL видео с YouTube, чтобы скачать его."
19
+ )
20
+
21
+ iface.launch()