From 3b1b03002502c92d234aa257c4c27db75e4dfa1d Mon Sep 17 00:00:00 2001 From: Shane Date: Mon, 12 May 2025 22:55:45 +1000 Subject: [PATCH] fix rss script pixabay --- foodie_utils.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/foodie_utils.py b/foodie_utils.py index 5437e34..90c190b 100644 --- a/foodie_utils.py +++ b/foodie_utils.py @@ -1304,7 +1304,7 @@ def get_image(search_query): logger.info(f"Skipping Pixabay image with too much text: {image_url} ({word_count} words)") return None - return img_url, source_name, uploader, page_url + return image_url, source_name, page_url, width, height except Exception as e: logger.warning(f"Failed to process Pixabay image {image_url}: {e}") return None @@ -1327,10 +1327,11 @@ def get_image(search_query): # Process the image for watermarks and resolution result = process_image(img_url, "Pixabay", page_url) if result: + image_url, source_name, page_url, width, height = result used_images.add(img_url) save_used_images() - logger.info(f"Selected Pixabay image: {img_url} by {uploader} for query '{query}' ({result[0].split('x')[0]}x{result[0].split('x')[1]})") - return result + logger.info(f"Selected Pixabay image: {img_url} by {uploader} for query '{query}' ({width}x{height})") + return image_url, source_name, uploader, page_url logger.info(f"No valid Pixabay image found for query '{query}'. Trying fallback query.") return None, None, None, None