add more checks for failures

This commit is contained in:
rra 2022-06-01 05:51:25 +02:00
parent 9c824fcd3f
commit ad591ea9cf

View File

@ -152,10 +152,13 @@ def parse_enclosures(post_dir, entry):
#TODO handle the fact it could be multiple items #TODO handle the fact it could be multiple items
for e in entry.enclosures: for e in entry.enclosures:
if "type" in e:
print("found enclosed media", e.type) print("found enclosed media", e.type)
if "image/" in e.type: if "image/" in e.type:
featured_image = grab_media(post_dir, e.href) featured_image = grab_media(post_dir, e.href)
entry["featured_image"] = featured_image entry["featured_image"] = featured_image
else:
print("FIXME:ignoring enclosed", e.type)
return entry return entry
@ -267,6 +270,7 @@ def grab_feed(feed_url):
print(e) print(e)
return False return False
if "status" in data:
print(data.status, feed_url) print(data.status, feed_url)
if data.status == 200: if data.status == 200:
# 304 means the feed has not been modified since we last checked # 304 means the feed has not been modified since we last checked