Jeffgold commited on
Commit
24cbec9
·
1 Parent(s): 8179262

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -10
app.py CHANGED
@@ -85,7 +85,10 @@ def convert_video(video_file, quality, aspect_ratio, video_url):
85
  master_playlist_path = create_master_playlist(output_paths)
86
  output_paths.append(master_playlist_path)
87
 
88
- return [{'name': path.stem, 'url': f"{path.name}"} for path in output_paths]
 
 
 
89
 
90
  video_file = gr.inputs.File(label="Video File")
91
  quality = gr.inputs.Dropdown(
@@ -101,23 +104,16 @@ aspect_ratio = gr.inputs.Dropdown(
101
  standard_resolutions = [4320, 2160, 1440, 1080, 720, 480, 360, 240, 144] # 8K, 4K, 2K, Full HD, HD, SD in pixels
102
  video_url = gr.inputs.Textbox(label="Or enter video URL")
103
 
104
- def format_output(output):
105
- html = ""
106
- for file in output:
107
- html += f'<p><a href="{file["url"]}" target="_blank">{file["name"]}</a></p>'
108
- return html
109
-
110
- outputs = gr.outputs.HTML(label="Download Links", type="html")
111
 
112
  interface = gr.Interface(
113
  fn=convert_video,
114
  inputs=[video_file, quality, aspect_ratio, video_url],
115
  outputs=outputs,
116
- interpretation=format_output,
117
  title="Video Converter",
118
  description="A simple video converter app",
119
  allow_flagging=False,
120
  server_name="0.0.0.0",
121
  server_port=7860,
122
  )
123
- interface.launch()
 
85
  master_playlist_path = create_master_playlist(output_paths)
86
  output_paths.append(master_playlist_path)
87
 
88
+ html = ""
89
+ for path in output_paths:
90
+ html += f'<p><a href="{path.name}" target="_blank">{path.stem}</a></p>'
91
+ return html
92
 
93
  video_file = gr.inputs.File(label="Video File")
94
  quality = gr.inputs.Dropdown(
 
104
  standard_resolutions = [4320, 2160, 1440, 1080, 720, 480, 360, 240, 144] # 8K, 4K, 2K, Full HD, HD, SD in pixels
105
  video_url = gr.inputs.Textbox(label="Or enter video URL")
106
 
107
+ outputs = gr.outputs.HTML(label="Download Links")
 
 
 
 
 
 
108
 
109
  interface = gr.Interface(
110
  fn=convert_video,
111
  inputs=[video_file, quality, aspect_ratio, video_url],
112
  outputs=outputs,
 
113
  title="Video Converter",
114
  description="A simple video converter app",
115
  allow_flagging=False,
116
  server_name="0.0.0.0",
117
  server_port=7860,
118
  )
119
+ interface.launch()