handle exceptions where the url does not return a valid feed
This commit is contained in:
parent
16cbeaedb0
commit
fbbfa2aa46
@ -169,12 +169,16 @@ def grab_feed(feed_url):
|
|||||||
print(e)
|
print(e)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
print(data.status, feed_url)
|
if not data.bozo:
|
||||||
if data.status == 200:
|
print(data.status, feed_url)
|
||||||
#304 means the feed has not been modified since we last checked
|
if data.status == 200:
|
||||||
write_etag(feed_name, data)
|
#304 means the feed has not been modified since we last checked
|
||||||
return data
|
write_etag(feed_name, data)
|
||||||
return False
|
return data
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
print(data.bozo_exception, feed_url)
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
feed_urls = open('feeds_list.txt','r').read().splitlines()
|
feed_urls = open('feeds_list.txt','r').read().splitlines()
|
||||||
|
Loading…
Reference in New Issue
Block a user