lalithadevi commited on
Commit
c3b44d2
1 Parent(s): 4aab4a6

Update news_extractor/news_extractor.py

Browse files
Files changed (1) hide show
  1. news_extractor/news_extractor.py +6 -1
news_extractor/news_extractor.py CHANGED
@@ -89,7 +89,12 @@ def news_agg(rss):
89
  'cache-control': 'max-age=0',
90
  'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'
91
  }
92
- resp = r.get(rss, timeout=5, headers=headers)
 
 
 
 
 
93
  logging.warning(f'{rss}: {resp.status_code}')
94
  b = BeautifulSoup(resp.content, "xml")
95
  items = b.find_all("item")
 
89
  'cache-control': 'max-age=0',
90
  'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'
91
  }
92
+
93
+ timeout = 2
94
+ if rss.find('telanganatoday') >=0:
95
+ timeout = 5
96
+
97
+ resp = r.get(rss, timeout=timeout, headers=headers)
98
  logging.warning(f'{rss}: {resp.status_code}')
99
  b = BeautifulSoup(resp.content, "xml")
100
  items = b.find_all("item")