Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,6 +8,7 @@ import json
|
|
8 |
def find_rss(rss_url):
|
9 |
json_box=[]
|
10 |
json_dict={}
|
|
|
11 |
r = requests.get(f'{rss_url}')
|
12 |
soup = bs4.BeautifulSoup(r.content,'lxml')
|
13 |
for i,p in enumerate(soup.find_all("a")):
|
@@ -15,9 +16,13 @@ def find_rss(rss_url):
|
|
15 |
if ".xml" in p['href'] or ".json" in p['href'] or ".rss" in p['href']:
|
16 |
print (p['href'])
|
17 |
json_dict[str(p.text)]=p['href']
|
|
|
|
|
|
|
18 |
except Exception:
|
19 |
pass
|
20 |
json_box.append(json_dict)
|
|
|
21 |
return json_box
|
22 |
|
23 |
def get_rss(rss_url):
|
|
|
8 |
def find_rss(rss_url):
|
9 |
json_box=[]
|
10 |
json_dict={}
|
11 |
+
json_dict_other={}
|
12 |
r = requests.get(f'{rss_url}')
|
13 |
soup = bs4.BeautifulSoup(r.content,'lxml')
|
14 |
for i,p in enumerate(soup.find_all("a")):
|
|
|
16 |
if ".xml" in p['href'] or ".json" in p['href'] or ".rss" in p['href']:
|
17 |
print (p['href'])
|
18 |
json_dict[str(p.text)]=p['href']
|
19 |
+
else:
|
20 |
+
json_dict_other[str(p.text)]=p['href']
|
21 |
+
|
22 |
except Exception:
|
23 |
pass
|
24 |
json_box.append(json_dict)
|
25 |
+
json_box.append(json_dict_other)
|
26 |
return json_box
|
27 |
|
28 |
def get_rss(rss_url):
|