Spaces:
Runtime error
Runtime error
remove demo.m4a if exists
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from pytube import YouTube
|
| 3 |
import yt_dlp
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
# from faster_whisper import WhisperModel
|
|
@@ -57,6 +58,8 @@ ydl_opts = {
|
|
| 57 |
|
| 58 |
if st.session_state.youtube_url:
|
| 59 |
with st.status("Get video Audio..."):
|
|
|
|
|
|
|
| 60 |
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
| 61 |
error_code = ydl.download([st.session_state.youtube_url])
|
| 62 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from pytube import YouTube
|
| 3 |
import yt_dlp
|
| 4 |
+
import os
|
| 5 |
|
| 6 |
|
| 7 |
# from faster_whisper import WhisperModel
|
|
|
|
| 58 |
|
| 59 |
if st.session_state.youtube_url:
|
| 60 |
with st.status("Get video Audio..."):
|
| 61 |
+
if os.path.exists('demo.m4a'):
|
| 62 |
+
os.remove('demo.m4a')
|
| 63 |
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
| 64 |
error_code = ydl.download([st.session_state.youtube_url])
|
| 65 |
|