Omnibus commited on
Commit
d79b662
·
verified ·
1 Parent(s): 5edf396

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -12
app.py CHANGED
@@ -207,21 +207,25 @@ def find_rss():
207
  rss_url=ea['link']
208
  r = requests.get(f'{rss_url}')
209
  if r.status_code == 200:
210
- if ".json" in rss_url:
211
- lod = json.loads(r.text)
212
- if ".xml" in rss_url:
213
- lod = xmltodict.parse(r.content)
214
- if ".rss" in rss_url:
215
- lod = xmltodict.parse(r.content)
216
- else:
217
- try:
218
  lod = xmltodict.parse(r.content)
219
- except Exception as e:
220
- lod=f'{rss_url} ::ERROR:: {e}'
 
 
 
 
 
 
 
221
  else:
222
- lod = r.status_code
 
223
  out_box.append(lod)
224
- yield out_box
225
 
226
  with gr.Blocks() as app:
227
  with gr.Row():
 
207
  rss_url=ea['link']
208
  r = requests.get(f'{rss_url}')
209
  if r.status_code == 200:
210
+ try:
211
+ if ".json" in rss_url:
212
+ lod = json.loads(r.text)
213
+ if ".xml" in rss_url:
 
 
 
 
214
  lod = xmltodict.parse(r.content)
215
+ if ".rss" in rss_url:
216
+ lod = xmltodict.parse(r.content)
217
+ else:
218
+ try:
219
+ lod = xmltodict.parse(r.content)
220
+ except Exception as e:
221
+ lod=f'{rss_url} ::ERROR:: {e}'
222
+ except Exception as e:
223
+ lod=f'{rss_url} ::ERROR:: {e}'
224
  else:
225
+ lod = f'{rss_url} ::ERROR:: {e}'
226
+ pass
227
  out_box.append(lod)
228
+ yield out_box
229
 
230
  with gr.Blocks() as app:
231
  with gr.Row():