Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -112,7 +112,7 @@ async def convert_stream(
|
|
112 |
yield None, None, "Starting YouTube download..."
|
113 |
out_uuid = uuid.uuid4().hex
|
114 |
out_template = str(UPLOAD_FOLDER / f"{out_uuid}.%(ext)s")
|
115 |
-
ytdlp_cmd = ["yt-dlp", "--extractor-args", "youtube:player_client=
|
116 |
stdout, stderr, rc = await run_command_capture(ytdlp_cmd)
|
117 |
files = list(UPLOAD_FOLDER.glob(f"{out_uuid}.*"))
|
118 |
if not files:
|
@@ -212,7 +212,7 @@ with gr.Blocks(title="Low Quality Video Inator (fdkaac)") as demo:
|
|
212 |
gr.Markdown("## Low Quality Video Inator\nUpload a file or paste a YouTube URL.")
|
213 |
|
214 |
with gr.Row():
|
215 |
-
use_youtube = gr.Checkbox(label="Use YouTube URL", value=False)
|
216 |
youtube_url = gr.Textbox(label="YouTube URL", placeholder="https://youtube.com/...")
|
217 |
|
218 |
video_file = gr.File(label="Upload Video", file_types=list(ALLOWED_EXTENSIONS))
|
@@ -228,7 +228,7 @@ with gr.Blocks(title="Low Quality Video Inator (fdkaac)") as demo:
|
|
228 |
video_bitrate = gr.Number(label="Video bitrate (kbps)", value=64, visible=False)
|
229 |
|
230 |
def toggle_bitrate(v):
|
231 |
-
return gr.update(visible=v)
|
232 |
custom_bitrate.change(toggle_bitrate, inputs=[custom_bitrate], outputs=[video_bitrate])
|
233 |
|
234 |
convert_btn = gr.Button("Convert Now", variant="primary")
|
|
|
112 |
yield None, None, "Starting YouTube download..."
|
113 |
out_uuid = uuid.uuid4().hex
|
114 |
out_template = str(UPLOAD_FOLDER / f"{out_uuid}.%(ext)s")
|
115 |
+
ytdlp_cmd = ["yt-dlp", "--extractor-args", "youtube:player_client=tv_simply", "-f", "b", "-o", out_template, youtube_url]
|
116 |
stdout, stderr, rc = await run_command_capture(ytdlp_cmd)
|
117 |
files = list(UPLOAD_FOLDER.glob(f"{out_uuid}.*"))
|
118 |
if not files:
|
|
|
212 |
gr.Markdown("## Low Quality Video Inator\nUpload a file or paste a YouTube URL.")
|
213 |
|
214 |
with gr.Row():
|
215 |
+
use_youtube = gr.Checkbox(label="Use YouTube URL (can't resolve YouTube on huggingface)", value=False)
|
216 |
youtube_url = gr.Textbox(label="YouTube URL", placeholder="https://youtube.com/...")
|
217 |
|
218 |
video_file = gr.File(label="Upload Video", file_types=list(ALLOWED_EXTENSIONS))
|
|
|
228 |
video_bitrate = gr.Number(label="Video bitrate (kbps)", value=64, visible=False)
|
229 |
|
230 |
def toggle_bitrate(v):
|
231 |
+
return gr.update(visible=v)
|
232 |
custom_bitrate.change(toggle_bitrate, inputs=[custom_bitrate], outputs=[video_bitrate])
|
233 |
|
234 |
convert_btn = gr.Button("Convert Now", variant="primary")
|