From 86074c87d74b4cbc8f9f4a032bee46222e0ed657 Mon Sep 17 00:00:00 2001 From: Will Miao <13051207myq@gmail.com> Date: Mon, 15 Sep 2025 19:24:09 +0800 Subject: [PATCH] refactor(downloader): update download_to_memory calls to include response headers --- py/services/civitai_client.py | 2 +- py/services/download_manager.py | 2 +- py/utils/routes_common.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/py/services/civitai_client.py b/py/services/civitai_client.py index 04d56d29..e037ba35 100644 --- a/py/services/civitai_client.py +++ b/py/services/civitai_client.py @@ -94,7 +94,7 @@ class CivitaiClient: async def download_preview_image(self, image_url: str, save_path: str): try: downloader = await get_downloader() - success, content = await downloader.download_to_memory( + success, content, headers = await downloader.download_to_memory( image_url, use_auth=False # Preview images don't need auth ) diff --git a/py/services/download_manager.py b/py/services/download_manager.py index 26f3f97d..76b974fb 100644 --- a/py/services/download_manager.py +++ b/py/services/download_manager.py @@ -463,7 +463,7 @@ class DownloadManager: # Download the original image to temp path using downloader downloader = await get_downloader() - success, content = await downloader.download_to_memory( + success, content, headers = await downloader.download_to_memory( images[0]['url'], use_auth=False ) diff --git a/py/utils/routes_common.py b/py/utils/routes_common.py index 3be2677f..db2f94db 100644 --- a/py/utils/routes_common.py +++ b/py/utils/routes_common.py @@ -141,7 +141,7 @@ class ModelRouteUtils: else: # For images, download and then optimize to WebP using downloader downloader = await get_downloader() - success, content = await downloader.download_to_memory( + success, content, headers = await downloader.download_to_memory( first_preview['url'], use_auth=False )