artificialguybr commited on
Commit
4e9af05
1 Parent(s): 4d47eb6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -60,25 +60,27 @@ def convert_to_mp4(input_file):
60
  def gradio_interface(url, auth_token=""):
61
  mkv_file = download_twitch_clip(url, auth_token)
62
  mp4_file = convert_to_mp4(mkv_file)
63
- return mp4_file
64
 
65
  with gr.Blocks() as app:
66
  gr.Markdown(title_and_description)
67
 
68
  with gr.Row():
69
  with gr.Column():
70
- result_video = gr.Video(label="Converted Video")
71
-
 
72
  with gr.Row():
73
  with gr.Column():
74
  url_input = gr.Textbox(label="Twitch Clip URL")
75
  auth_token_input = gr.Textbox(label="Authentication Token (optional)", type="password")
76
- run_btn = gr.Button("Download and Convert")
77
 
78
  run_btn.click(
79
  gradio_interface,
80
  inputs=[url_input, auth_token_input],
81
- outputs=[result_video]
82
  )
 
83
  app.queue()
84
  app.launch()
 
60
  def gradio_interface(url, auth_token=""):
61
  mkv_file = download_twitch_clip(url, auth_token)
62
  mp4_file = convert_to_mp4(mkv_file)
63
+ return mp4_file, mp4_file # Return the file path twice, for both the video and file components
64
 
65
  with gr.Blocks() as app:
66
  gr.Markdown(title_and_description)
67
 
68
  with gr.Row():
69
  with gr.Column():
70
+ result_video = gr.Video(label="Vídeo Output")
71
+ download_link = gr.File(label="Download MP4") # File component for downloading
72
+
73
  with gr.Row():
74
  with gr.Column():
75
  url_input = gr.Textbox(label="Twitch Clip URL")
76
  auth_token_input = gr.Textbox(label="Authentication Token (optional)", type="password")
77
+ run_btn = gr.Button("Download Clip")
78
 
79
  run_btn.click(
80
  gradio_interface,
81
  inputs=[url_input, auth_token_input],
82
+ outputs=[result_video, download_link] # Include the file component in the outputs
83
  )
84
+
85
  app.queue()
86
  app.launch()