Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -88,10 +88,13 @@ def convert_video(video_file, quality, aspect_ratio, video_url):
|
|
88 |
master_playlist_path = create_master_playlist(output_paths)
|
89 |
output_paths.append(master_playlist_path)
|
90 |
|
91 |
-
|
92 |
-
|
|
|
|
|
93 |
|
94 |
-
|
|
|
95 |
|
96 |
# Change "video" to "file"
|
97 |
video_url = gr.inputs.Textbox(placeholder="or paste video url here", label="Video URL")
|
@@ -107,7 +110,7 @@ aspect_ratio = gr.inputs.Dropdown(choices=aspect_ratios, label="Aspect Ratio", d
|
|
107 |
interface = gr.Interface(
|
108 |
fn=convert_video,
|
109 |
inputs=[video_file, quality, aspect_ratio, video_url],
|
110 |
-
outputs=gr.outputs.
|
111 |
title="NEAR Hub Video Transcoder to m3u8",
|
112 |
description="convert video files to m3u8 for VOD streaming",
|
113 |
allow_flagging=False
|
|
|
88 |
master_playlist_path = create_master_playlist(output_paths)
|
89 |
output_paths.append(master_playlist_path)
|
90 |
|
91 |
+
# After generating the video files, create links to them
|
92 |
+
output_links = []
|
93 |
+
for path in output_files:
|
94 |
+
output_links.append(f'<a href="{path}" target="_blank">Download {Path(path).stem}</a>')
|
95 |
|
96 |
+
output_html = "<br>".join(output_links)
|
97 |
+
return output_html
|
98 |
|
99 |
# Change "video" to "file"
|
100 |
video_url = gr.inputs.Textbox(placeholder="or paste video url here", label="Video URL")
|
|
|
110 |
interface = gr.Interface(
|
111 |
fn=convert_video,
|
112 |
inputs=[video_file, quality, aspect_ratio, video_url],
|
113 |
+
outputs=gr.outputs.HTML(label="Download Links"),
|
114 |
title="NEAR Hub Video Transcoder to m3u8",
|
115 |
description="convert video files to m3u8 for VOD streaming",
|
116 |
allow_flagging=False
|