Kryptone commited on
Commit
0864990
·
verified ·
1 Parent(s): 3b5fc1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -217,6 +217,12 @@ def download_video_as_audio_only(yt_video, audio_output_format):
217
  with zipfile.ZipFile(single_zip_name, 'w') as zip_file:
218
  for audio_file in audio_files:
219
  zip_file.write(audio_file, os.path.basename(audio_file))
 
 
 
 
 
 
220
  return "Done! Download the zip file below! This only contains the audio file.", single_zip_name
221
 
222
  with gr.Blocks(theme='sudeepshouche/minimalist', title="Global Dataset Maker") as app:
@@ -325,6 +331,7 @@ with gr.Blocks(theme='sudeepshouche/minimalist', title="Global Dataset Maker") a
325
  [gr.Text(label="Output"), gr.File(label="Zipped audio file")]
326
  )
327
  with gr.TabItem("Changelog"):
 
328
  gr.Markdown("v0.94 - Added new tool: YouTube-to-audio.")
329
  gr.Markdown("v0.93 - Removed obsolete warnings and fixed issue with all-in-one if output.mp3 or output.wav doesnt exist.")
330
  gr.Markdown("v0.92 - Added all-in-one tab under Misc Tools.")
 
217
  with zipfile.ZipFile(single_zip_name, 'w') as zip_file:
218
  for audio_file in audio_files:
219
  zip_file.write(audio_file, os.path.basename(audio_file))
220
+ for outputwavremoval in glob.glob("*.wav"):
221
+ if os.path.exists(outputwavremoval):
222
+ os.remove(outputwavremoval)
223
+ for outputmp3removal in glob.glob("*.mp3"):
224
+ if os.path.exists(outputmp3removal):
225
+ os.remove(outputmp3removal)
226
  return "Done! Download the zip file below! This only contains the audio file.", single_zip_name
227
 
228
  with gr.Blocks(theme='sudeepshouche/minimalist', title="Global Dataset Maker") as app:
 
331
  [gr.Text(label="Output"), gr.File(label="Zipped audio file")]
332
  )
333
  with gr.TabItem("Changelog"):
334
+ gr.Markdown("v0.94a - Fixed issue with existing output.wav or output.mp3 files clashing with the split audio files with addition of the new tool.")
335
  gr.Markdown("v0.94 - Added new tool: YouTube-to-audio.")
336
  gr.Markdown("v0.93 - Removed obsolete warnings and fixed issue with all-in-one if output.mp3 or output.wav doesnt exist.")
337
  gr.Markdown("v0.92 - Added all-in-one tab under Misc Tools.")