add warning to audio only tab
Browse files
app.py
CHANGED
@@ -206,8 +206,6 @@ def download_video_as_audio_only(yt_video, audio_output_format):
|
|
206 |
audio_clip = video_clip.audio
|
207 |
if audio_output_format == "wav":
|
208 |
audio_clip.write_audiofile("output.wav")
|
209 |
-
elif audio_output_format == "mp3":
|
210 |
-
audio_clip.write_audiofile("output.mp3")
|
211 |
audio_clip.close()
|
212 |
video_clip.close()
|
213 |
for mp4remove in glob.glob("*.mp4"):
|
@@ -220,9 +218,6 @@ def download_video_as_audio_only(yt_video, audio_output_format):
|
|
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:
|
@@ -232,7 +227,6 @@ with gr.Blocks(theme='sudeepshouche/minimalist', title="Global Dataset Maker") a
|
|
232 |
gr.Markdown(
|
233 |
"This Space will create a dataset for you, all automatically. **Please be warned that due to not having a GPU on this Space, some steps might take longer to complete.**"
|
234 |
)
|
235 |
-
gr.HTML("<h1> MP3 file support works for downloading a video and splitting a single file. </h1>")
|
236 |
with gr.Tabs():
|
237 |
with gr.TabItem("Download Video"):
|
238 |
with gr.Row():
|
@@ -318,12 +312,13 @@ with gr.Blocks(theme='sudeepshouche/minimalist', title="Global Dataset Maker") a
|
|
318 |
[gr.Text(label="Result"), gr.File(label="Zipped files")]
|
319 |
)
|
320 |
with gr.Tab("Audio only download"):
|
|
|
321 |
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.")
|
322 |
with gr.Row():
|
323 |
with gr.Column():
|
324 |
with gr.Row():
|
325 |
yt_video = gr.Textbox(label="URL")
|
326 |
-
audio_output_format = gr.Radio(["wav", "mp3"], value="wav", label="Download audio as:")
|
327 |
commence_download = gr.Button("Download", variant='primary')
|
328 |
commence_download.click(
|
329 |
download_video_as_audio_only,
|
|
|
206 |
audio_clip = video_clip.audio
|
207 |
if audio_output_format == "wav":
|
208 |
audio_clip.write_audiofile("output.wav")
|
|
|
|
|
209 |
audio_clip.close()
|
210 |
video_clip.close()
|
211 |
for mp4remove in glob.glob("*.mp4"):
|
|
|
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:
|
|
|
227 |
gr.Markdown(
|
228 |
"This Space will create a dataset for you, all automatically. **Please be warned that due to not having a GPU on this Space, some steps might take longer to complete.**"
|
229 |
)
|
|
|
230 |
with gr.Tabs():
|
231 |
with gr.TabItem("Download Video"):
|
232 |
with gr.Row():
|
|
|
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,
|