Omnibus commited on
Commit
b962252
1 Parent(s): e343b9b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -23,13 +23,15 @@ def link_find(url):
23
  #https://huggingface.co/spaces/Omnibus/crawl
24
 
25
  def sitemap(url):
 
26
  if url != "" and url != None:
27
  link1=link_find(url)
28
  for i,ea in enumerate(link1):
29
  print(ea)
30
- if url.endswith("/"):
31
- url=url.strip("/")
32
- out_list=link_find(f"{url}{ea['URL']}")
 
33
  link1[i]['TREE']=ea["TREE"].append(out_list)
34
  return link1
35
  with gr.Blocks() as app:
 
23
  #https://huggingface.co/spaces/Omnibus/crawl
24
 
25
  def sitemap(url):
26
+ uri=""
27
  if url != "" and url != None:
28
  link1=link_find(url)
29
  for i,ea in enumerate(link1):
30
  print(ea)
31
+ if not ea.startswith("http"):
32
+
33
+ uri=url.split("/",3)[1]
34
+ out_list=link_find(f"{uri}{ea['URL']}")
35
  link1[i]['TREE']=ea["TREE"].append(out_list)
36
  return link1
37
  with gr.Blocks() as app: