Skip to content

Instantly share code, notes, and snippets.

@nabeen
Created November 1, 2017 10:54
Show Gist options
  • Save nabeen/e22243d2c1c383a321684669a21efaca to your computer and use it in GitHub Desktop.
Save nabeen/e22243d2c1c383a321684669a21efaca to your computer and use it in GitHub Desktop.
request = service.files().get_media(fileId=foo)
dirname = bar
name = baz
os.makedirs(dirname, 0o777, True)
fh = io.FileIO(os.path.join(dirname, name), mode='wb')
downloader = MediaIoBaseDownload(fh, request)
done = False
while done is False:
status, done = downloader.next_chunk()
print("Download %d%%." % int(status.progress() * 100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment