Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,24 +10,26 @@ PAGE_LINK
|
|
10 |
"""
|
11 |
def load_json(url1="",url2="",url3="",url4=""):
|
12 |
get_url=f'{main_directory}{url1}{url2}{url3}{url4}'
|
13 |
-
|
14 |
if get_url.endswith('.json"'):
|
|
|
15 |
return feed1.text
|
16 |
|
17 |
def make_tree(url1="",url2="",url3="",url4=""):
|
18 |
link_box=[]
|
19 |
html_out=""
|
20 |
get_url=f'{main_directory}{url1}{url2}{url3}{url4}'
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
|
|
31 |
|
32 |
def run():
|
33 |
out=make_tree()
|
|
|
10 |
"""
|
11 |
def load_json(url1="",url2="",url3="",url4=""):
|
12 |
get_url=f'{main_directory}{url1}{url2}{url3}{url4}'
|
13 |
+
print(get_url)
|
14 |
if get_url.endswith('.json"'):
|
15 |
+
feed1 = requests.get(get_url)
|
16 |
return feed1.text
|
17 |
|
18 |
def make_tree(url1="",url2="",url3="",url4=""):
|
19 |
link_box=[]
|
20 |
html_out=""
|
21 |
get_url=f'{main_directory}{url1}{url2}{url3}{url4}'
|
22 |
+
if not get_url.endswith('.json"'):
|
23 |
+
feed1 = requests.get(get_url)
|
24 |
+
spl = feed1.text.split("href=")
|
25 |
+
for line in spl:
|
26 |
+
spl2 = line.split(">")[0]
|
27 |
+
print(spl2)
|
28 |
+
if spl2.endswith('/"') or spl2.endswith('.json"'):
|
29 |
+
fin=line.split(">")[0].strip('""')
|
30 |
+
link_box.append(fin)
|
31 |
+
#html_out=html_out+html.replace("PAGE_LINK",fin)
|
32 |
+
return gr.update(choices=[l for l in link_box],interactive=True)
|
33 |
|
34 |
def run():
|
35 |
out=make_tree()
|