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
for e in entry.enclosures:
if "type" in e:
print("found enclosed media", e.type)
if "image/" in e.type:
featured_image = grab_media(post_dir, e.href)
entry["featured_image"] = featured_image
else:
print("FIXME:ignoring enclosed", e.type)
return entry
@ -267,6 +270,7 @@ def grab_feed(feed_url):
print(e)
return False
if "status" in data:
print(data.status, feed_url)
if data.status == 200:
# 304 means the feed has not been modified since we last checked