Spaces:
Paused
Paused
adding new audio file types
Browse files3 unmodified lines4567891011129 unmodified lines222324252627283 unmodified linesdef fetch(url, name, ext):opts = {"mp3": "-f \"ba\" -x --audio-format mp3","mp4": "-f \"bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best\"",}[ext]filename = f"{name}.{ext}"try:9 unmodified linesinputs=[gr.Textbox(label="Link Address", placeholder="Enter the URL here ..."),gr.Textbox(label="File Name", placeholder="Example: file_name"),gr.Dropdown(["mp3", "mp4"], value="mp4", label="File Type")],outputs=gr.File(label="Download!"),description="Download from X, Youtube, Reddit, etc..",3 unmodified lines4567891011121314159 unmodified lines252627282930313 unmodified linesdef fetch(url, name, ext):opts = {"mp3": "-f \"ba\" -x --audio-format mp3", # MP3 format"mp4": "-f \"bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best\"", # MP4 format for video + audio"flac": "-f \"ba\" -x --audio-format flac", # FLAC format for lossless audio"aac": "-f \"ba\" -x --audio-format aac" # AAC format for lossy high-quality audio}[ext]filename = f"{name}.{ext}"try:9 unmodified linesinputs=[gr.Textbox(label="Link Address", placeholder="Enter the URL here ..."),gr.Textbox(label="File Name", placeholder="Example: file_name"),gr.Dropdown(["mp3", "mp4", "flac", "aac"], value="mp3", label="File Type")],outputs=gr.File(label="Download!"),description="Download from X, Youtube, Reddit, etc..",
app.py+6-3