I am trying to download .feather file from Drive, the file size is 3.88 GB but only 104857601 bythes are downloaded.
Here is my code, I have compared with other code snippets that are available on diff. sites and it almost identical. Here is one that I used for reference. Thanks for your help.
def download_file(drive_service, file_id: str, file_name: str):
"""Downloads a filefrom public share Google drive
Args:
real_file_id: ID of the file to download
Returns : IO object with location.
"""
try:
request = drive_service.files().get_media(fileId=file_id)
file = io.BytesIO()
downloader = MediaIoBaseDownload(file, request)
done = False
print("Downloading file {}....".format(file_name))
while done is False:
status, done = downloader.next_chunk()
if int(status.progress() * 100) in [0, 25, 50, 75, 100]:
print(F'Download {int(status.progress() * 100)}%.')
file.seek(0)
with open(file_name, 'wb') as f:
f.write(file.read())
f.close()
return True
except HttpError as error:
print(F'An error occurred: {error}')
file = None
return False