DavidCombei commited on
Commit
e239e76
1 Parent(s): 996b7d8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -81,8 +81,10 @@ def download_audio_from_youtube(youtube_url, output_path='.', cookies_file='cook
81
 
82
  with youtube_dl.YoutubeDL(ydl_opts) as ydl:
83
  info_dict = ydl.extract_info(youtube_url, download=True)
84
- # Force replace with .wav
85
  audio_file = ydl.prepare_filename(info_dict).replace('.webm', '.wav')
 
 
86
  return audio_file
87
 
88
  def segment_audio(audio, sr, segment_duration):
 
81
 
82
  with youtube_dl.YoutubeDL(ydl_opts) as ydl:
83
  info_dict = ydl.extract_info(youtube_url, download=True)
84
+ # force replace with .wav because webm is not supported by librosa
85
  audio_file = ydl.prepare_filename(info_dict).replace('.webm', '.wav')
86
+ if os.path.exists('cookies.txt'):
87
+ os.remove('cookies.txt')
88
  return audio_file
89
 
90
  def segment_audio(audio, sr, segment_duration):