Omnibus commited on
Commit
56000e1
·
verified ·
1 Parent(s): e4e5afb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -28,6 +28,9 @@ def load_json(url1="",url2="",url3="",url4=""):
28
  get_url=f'{main_directory}{url1}{url2}{url3}{url4}'
29
  print(f'{get_url}')
30
  get_url=get_url.split("None")[0]
 
 
 
31
 
32
  if get_url.endswith('.json'):
33
  feed1 = requests.get(get_url)
@@ -35,7 +38,6 @@ def load_json(url1="",url2="",url3="",url4=""):
35
  elif get_url.endswith(".png") or get_url.endswith(".gif") or get_url.endswith(".jpg"):
36
  html_out=f"<style>{css}</style><div>"
37
  html_out+=f'<div class="img_class"><a href="{get_url}" target="_blank">{get_url}</a><br><img src={get_url}></div></div>'
38
-
39
  return html_out, None
40
  return None,None
41
 
@@ -90,7 +92,7 @@ with gr.Blocks() as app:
90
  drop2=gr.Dropdown()
91
  drop3=gr.Dropdown()
92
  drop4=gr.Dropdown()
93
- load_btn=gr.Button("Load JSON")
94
  html_raw=gr.HTML()
95
  links=gr.JSON()
96
 
 
28
  get_url=f'{main_directory}{url1}{url2}{url3}{url4}'
29
  print(f'{get_url}')
30
  get_url=get_url.split("None")[0]
31
+ print(f'{get_url}')
32
+ get_url=get_url.split("[]")[0]
33
+ print(f'{get_url}')
34
 
35
  if get_url.endswith('.json'):
36
  feed1 = requests.get(get_url)
 
38
  elif get_url.endswith(".png") or get_url.endswith(".gif") or get_url.endswith(".jpg"):
39
  html_out=f"<style>{css}</style><div>"
40
  html_out+=f'<div class="img_class"><a href="{get_url}" target="_blank">{get_url}</a><br><img src={get_url}></div></div>'
 
41
  return html_out, None
42
  return None,None
43
 
 
92
  drop2=gr.Dropdown()
93
  drop3=gr.Dropdown()
94
  drop4=gr.Dropdown()
95
+ load_btn=gr.Button("Load")
96
  html_raw=gr.HTML()
97
  links=gr.JSON()
98