Kryptone commited on
Commit
ccd7c61
·
verified ·
1 Parent(s): 32abb1c

check changelog tab

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -211,13 +211,16 @@ def download_video_as_audio_only(yt_video, audio_output_format):
211
  for mp4remove in glob.glob("*.mp4"):
212
  os.remove(mp4remove)
213
  single_zip_name = "only_audio.zip"
214
- audio_files = glob.glob("*.wav")
215
  with zipfile.ZipFile(single_zip_name, 'w') as zip_file:
216
  for audio_file in audio_files:
217
  zip_file.write(audio_file, os.path.basename(audio_file))
218
  for outputwavremoval in glob.glob("*.wav"):
219
  if os.path.exists(outputwavremoval):
220
  os.remove(outputwavremoval)
 
 
 
221
  return "Done! Download the zip file below! This only contains the audio file.", single_zip_name
222
 
223
  with gr.Blocks(theme='sudeepshouche/minimalist', title="Global Dataset Maker") as app:
@@ -312,13 +315,12 @@ with gr.Blocks(theme='sudeepshouche/minimalist', title="Global Dataset Maker") a
312
  [gr.Text(label="Result"), gr.File(label="Zipped files")]
313
  )
314
  with gr.Tab("Audio only download"):
315
- gr.HTML("<h1> MP3 download is currently broken. A fix is being implemented.")
316
  gr.Markdown("If you want to download only the audio (to isolate bgm using UVR, etc), use this method, which will only extract audio and not split the audio.")
317
  with gr.Row():
318
  with gr.Column():
319
  with gr.Row():
320
  yt_video = gr.Textbox(label="URL")
321
- audio_output_format = gr.Radio(["wav", "mp3"], value="wav", label="Download audio as:", interactive=False, info="MP3 is currently broken. You cannot currently change from the default.")
322
  commence_download = gr.Button("Download", variant='primary')
323
  commence_download.click(
324
  download_video_as_audio_only,
@@ -326,6 +328,7 @@ with gr.Blocks(theme='sudeepshouche/minimalist', title="Global Dataset Maker") a
326
  [gr.Text(label="Output"), gr.File(label="Zipped audio file")]
327
  )
328
  with gr.TabItem("Changelog"):
 
329
  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.")
330
  gr.Markdown("v0.94 - Added new tool: YouTube-to-audio.")
331
  gr.Markdown("v0.93 - Removed obsolete warnings and fixed issue with all-in-one if output.mp3 or output.wav doesnt exist.")
 
211
  for mp4remove in glob.glob("*.mp4"):
212
  os.remove(mp4remove)
213
  single_zip_name = "only_audio.zip"
214
+ audio_files = glob.glob("*.wav") if audio_output_format == "wav" else glob.glob("*.mp3")
215
  with zipfile.ZipFile(single_zip_name, 'w') as zip_file:
216
  for audio_file in audio_files:
217
  zip_file.write(audio_file, os.path.basename(audio_file))
218
  for outputwavremoval in glob.glob("*.wav"):
219
  if os.path.exists(outputwavremoval):
220
  os.remove(outputwavremoval)
221
+ for outputmp3removal in glob.glob("*.mp3"):
222
+ if os.path.exists(outputmp3removal):
223
+ os.remove(outputmp3removal)
224
  return "Done! Download the zip file below! This only contains the audio file.", single_zip_name
225
 
226
  with gr.Blocks(theme='sudeepshouche/minimalist', title="Global Dataset Maker") as app:
 
315
  [gr.Text(label="Result"), gr.File(label="Zipped files")]
316
  )
317
  with gr.Tab("Audio only download"):
 
318
  gr.Markdown("If you want to download only the audio (to isolate bgm using UVR, etc), use this method, which will only extract audio and not split the audio.")
319
  with gr.Row():
320
  with gr.Column():
321
  with gr.Row():
322
  yt_video = gr.Textbox(label="URL")
323
+ audio_output_format = gr.Radio(["wav", "mp3"], value="wav", label="Download audio as:")
324
  commence_download = gr.Button("Download", variant='primary')
325
  commence_download.click(
326
  download_video_as_audio_only,
 
328
  [gr.Text(label="Output"), gr.File(label="Zipped audio file")]
329
  )
330
  with gr.TabItem("Changelog"):
331
+ gr.Markdown("v0.95 - Fixed issue with mp3 files not downloading audio properly.")
332
  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.")
333
  gr.Markdown("v0.94 - Added new tool: YouTube-to-audio.")
334
  gr.Markdown("v0.93 - Removed obsolete warnings and fixed issue with all-in-one if output.mp3 or output.wav doesnt exist.")