From 028bc1df84c9089391bd20f4c90d4db8a3f3ec16 Mon Sep 17 00:00:00 2001 From: rra Date: Wed, 20 Nov 2024 11:25:26 +0100 Subject: [PATCH] fix issue where posts with enclosures would not download files because of missing dir --- konfluks/feed.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/konfluks/feed.py b/konfluks/feed.py index 53435ba..844e0da 100644 --- a/konfluks/feed.py +++ b/konfluks/feed.py @@ -155,6 +155,8 @@ def parse_enclosures(post_dir, entry): if "type" in e: print("found enclosed media", e.type) if "image/" in e.type: + if not os.path.exists(post_dir): #this might be redundant with create_post + os.makedirs(post_dir) featured_image = grab_media(post_dir, e.href) media_item = urlparse(e.href).path.split('/')[-1] entry["featured_image"] = media_item