From c237e1510845dcffc6fe361353486d45f897bc11 Mon Sep 17 00:00:00 2001 From: Batuhan Taskaya Date: Fri, 17 Dec 2021 11:00:03 +0300 Subject: [PATCH] Faster downloads through bigger chunks / less buffering (#1236) --- httpie/downloads.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/httpie/downloads.py b/httpie/downloads.py index 6de9628c..d8a5dd04 100644 --- a/httpie/downloads.py +++ b/httpie/downloads.py @@ -271,7 +271,6 @@ class Downloader: with_headers=False, with_body=True, on_body_chunk_downloaded=self.chunk_downloaded, - chunk_size=1024 * 8 ) self._progress_reporter.output.write( @@ -324,7 +323,7 @@ class Downloader: content_type=final_response.headers.get('Content-Type'), ) unique_filename = get_unique_filename(filename) - return open(unique_filename, mode='a+b') + return open(unique_filename, buffering=0, mode='a+b') class DownloadStatus: