Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -36,16 +36,18 @@ def make_tree(url1="",url2="",url3="",url4=""):
|
|
36 |
return None
|
37 |
|
38 |
def get_images():
|
39 |
-
html_out="<div style='
|
40 |
get_url=f'{main_directory}images/'
|
41 |
|
42 |
feed1 = requests.get(get_url)
|
43 |
spl = feed1.text.split("href=")
|
44 |
for line in spl:
|
45 |
spl2 = line.split(">")[0].strip('""')
|
46 |
-
if
|
47 |
print(spl2)
|
48 |
html_out+=f'<div><a href="{get_url}{spl2}">{get_url}{spl2}</a><br><img src={get_url}{spl2}></div>'
|
|
|
|
|
49 |
html_out+="</div>"
|
50 |
return html_out
|
51 |
|
|
|
36 |
return None
|
37 |
|
38 |
def get_images():
|
39 |
+
html_out="<div style='column-count:2;'>"
|
40 |
get_url=f'{main_directory}images/'
|
41 |
|
42 |
feed1 = requests.get(get_url)
|
43 |
spl = feed1.text.split("href=")
|
44 |
for line in spl:
|
45 |
spl2 = line.split(">")[0].strip('""')
|
46 |
+
if spl2.endswith(".png|.gif|.jpg"):
|
47 |
print(spl2)
|
48 |
html_out+=f'<div><a href="{get_url}{spl2}">{get_url}{spl2}</a><br><img src={get_url}{spl2}></div>'
|
49 |
+
else:
|
50 |
+
print(spl2)
|
51 |
html_out+="</div>"
|
52 |
return html_out
|
53 |
|