Skip to content

Commit

Permalink
fix downloading json files from drive
Browse files Browse the repository at this point in the history
otherwise json files are downloaded during every sync and outpuf file has 0 bytes
  • Loading branch information
tymmej committed Oct 10, 2023
1 parent 78b2f13 commit ea7cd5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sync_drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit ea7cd5f

Please sign in to comment.