Jiedong Yang commited on
Commit
18d2fb0
β€’
1 Parent(s): daa5cfd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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.remove(path)
 
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