From aa9412e1b4908daa5dfffbd7bdc0b7fedb63187a Mon Sep 17 00:00:00 2001 From: unclecode Date: Tue, 23 Jul 2024 13:08:53 +0800 Subject: [PATCH] refactor: Set image_size to 0 in get_content_of_website_optimized The code change sets the `image_size` variable to 0 in the `get_content_of_website_optimized` function. This change is made to temporarily disable fetching the image file size, which was causing performance issues. The image size will be fetched in a future update to improve the functionality. --- crawl4ai/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl4ai/utils.py b/crawl4ai/utils.py index e50adb72..679c6d1d 100644 --- a/crawl4ai/utils.py +++ b/crawl4ai/utils.py @@ -496,7 +496,7 @@ def get_content_of_website_optimized(url: str, html: str, word_count_threshold: height_value, height_unit = parse_dimension(image_height) image_width = img.get('width') width_value, width_unit = parse_dimension(image_width) - image_size = int(fetch_image_file_size(img,base_url) or 0) + image_size = 0 #int(fetch_image_file_size(img,base_url) or 0) image_format = os.path.splitext(img.get('src',''))[1].lower() score = 0 if height_value: