Omnibus commited on
Commit
77889fa
·
1 Parent(s): 8690dda

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -5,6 +5,7 @@ import binascii
5
  def dl(inp):
6
  out = None
7
  out_file=[]
 
8
  try:
9
  inp_out=inp.replace("https://","")
10
  inp_out=inp_out.replace("/","_").replace(".","_")
@@ -16,7 +17,7 @@ def dl(inp):
16
  out_file.append(out)
17
  out_file.append(f"{inp_out}.description")
18
  out_file.append(f"{inp_out}.info.json")
19
-
20
  try:
21
  with open(f"{inp_out}.info.json", "r") as f:
22
  f_out = f.readlines()
@@ -30,7 +31,7 @@ def dl(inp):
30
  except Exception as e:
31
  print (e)
32
  out = None
33
- return out,out_file
34
 
35
 
36
  with gr.Blocks() as app:
@@ -38,7 +39,9 @@ with gr.Blocks() as app:
38
  go_btn = gr.Button()
39
  with gr.Row():
40
  outp_vid=gr.Video()
41
- outp_files=gr.Files()
42
- go_btn.click(dl,inp_url,[outp_vid,outp_files])
 
 
43
 
44
  app.launch()
 
5
  def dl(inp):
6
  out = None
7
  out_file=[]
8
+ out_json={}
9
  try:
10
  inp_out=inp.replace("https://","")
11
  inp_out=inp_out.replace("/","_").replace(".","_")
 
17
  out_file.append(out)
18
  out_file.append(f"{inp_out}.description")
19
  out_file.append(f"{inp_out}.info.json")
20
+ out_json=f'{inp_out}.info.json'
21
  try:
22
  with open(f"{inp_out}.info.json", "r") as f:
23
  f_out = f.readlines()
 
31
  except Exception as e:
32
  print (e)
33
  out = None
34
+ return out,out_file,out_json
35
 
36
 
37
  with gr.Blocks() as app:
 
39
  go_btn = gr.Button()
40
  with gr.Row():
41
  outp_vid=gr.Video()
42
+ with gr.Column():
43
+ outp_files=gr.Files()
44
+ out_json = gr.JSON()
45
+ go_btn.click(dl,inp_url,[outp_vid,outp_files,out_json])
46
 
47
  app.launch()