Jeffgold commited on
Commit
9985157
·
1 Parent(s): 4d4e03c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
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
- # After generating the video files, return paths to them
92
- output_files = [str(path) for path in output_paths]
 
 
93
 
94
- return output_files
 
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.Textbox(label="Paths to Output Files"),
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