Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,14 +38,14 @@ def cmd(url):
|
|
| 38 |
os.makedirs(download_dir)
|
| 39 |
|
| 40 |
# 显示下载进度条
|
| 41 |
-
stream.download(download_dir, filename=f'{title}.
|
| 42 |
|
| 43 |
# 打印下载完成信息
|
| 44 |
print('视频下载完成!')
|
| 45 |
|
| 46 |
# 下载成功,退出循环
|
| 47 |
#break
|
| 48 |
-
return download_dir+f'/{title}.
|
| 49 |
except Exception as e:
|
| 50 |
print(f'视频下载失败:{e}')
|
| 51 |
|
|
@@ -61,4 +61,4 @@ def cmd(url):
|
|
| 61 |
app = gr.Interface(fn=cmd, inputs=gr.Textbox(label="YouTube URL",lines=1), outputs=[gr.Video(label="Download the output Video")])
|
| 62 |
|
| 63 |
# 启动 Gradio 应用程序
|
| 64 |
-
app.launch(
|
|
|
|
| 38 |
os.makedirs(download_dir)
|
| 39 |
|
| 40 |
# 显示下载进度条
|
| 41 |
+
stream.download(download_dir, filename=f'{title}.MP4')
|
| 42 |
|
| 43 |
# 打印下载完成信息
|
| 44 |
print('视频下载完成!')
|
| 45 |
|
| 46 |
# 下载成功,退出循环
|
| 47 |
#break
|
| 48 |
+
return download_dir+f'/{title}.MP4'
|
| 49 |
except Exception as e:
|
| 50 |
print(f'视频下载失败:{e}')
|
| 51 |
|
|
|
|
| 61 |
app = gr.Interface(fn=cmd, inputs=gr.Textbox(label="YouTube URL",lines=1), outputs=[gr.Video(label="Download the output Video")])
|
| 62 |
|
| 63 |
# 启动 Gradio 应用程序
|
| 64 |
+
app.launch()
|