From ea7cd5f4be5339f19f9f467b5860dee653bcbb9c Mon Sep 17 00:00:00 2001 From: Jakub Tymejczyk Date: Tue, 10 Oct 2023 20:14:15 +0200 Subject: [PATCH] fix downloading json files from drive otherwise json files are downloaded during every sync and outpuf file has 0 bytes --- src/sync_drive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sync_drive.py b/src/sync_drive.py index a0a816e39..62eeaf903 100644 --- a/src/sync_drive.py +++ b/src/sync_drive.py @@ -194,7 +194,7 @@ def download_file(item, local_file): try: with item.open(stream=True) as response: with open(local_file, "wb") as file_out: - copyfileobj(response.raw, file_out) + file_out.write(response.content) if response.url and "/packageDownload?" in response.url: local_file = process_package(local_file=local_file) item_modified_time = time.mktime(item.date_modified.timetuple())