Spaces:
Runtime error
Runtime error
Jiedong Yang
commited on
Commit
β’
18d2fb0
1
Parent(s):
daa5cfd
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,8 @@ def audio_from_url(url, dst_dir='data', name=None, format='wav'):
|
|
28 |
|
29 |
# download audio
|
30 |
path = os.path.join(dst_dir, f"audio.{format}")
|
31 |
-
os.
|
|
|
32 |
os.system(f"yt-dlp -f 'ba' -x --audio-format {format} {url} -o {path} --quiet")
|
33 |
|
34 |
return path
|
|
|
28 |
|
29 |
# download audio
|
30 |
path = os.path.join(dst_dir, f"audio.{format}")
|
31 |
+
if os.path.exists(path):
|
32 |
+
os.remove(path)
|
33 |
os.system(f"yt-dlp -f 'ba' -x --audio-format {format} {url} -o {path} --quiet")
|
34 |
|
35 |
return path
|