voxel51 / eta

ETA: Extensible Toolkit for Analytics
https://voxel51.com
Apache License 2.0
29 stars 13 forks source link

Confirm large Google Drive downloads #554

Closed ehofesmann closed 2 years ago

ehofesmann commented 2 years ago

The previous method for confirming large file downloads from Google Drive seems to no longer work, this PR resolves that.

Example

import eta.core.web as etaw

fid_large = "1O-WMjtiBBMXGEHnnus6y2nSlJu8pY5vo"
fid_small = "1UWTlFmdq8H-wdJHxVsAKpXBilY1CWwm_"

_ = etaw.download_google_drive_file(fid_large)
# Previous download size: 17.3Kb
# Now: 281.7Mb

_ = etaw.download_google_drive_file(fid_small)
# Previous download size: 188.0Mb
# Now: 188.0Mb

Adding "confirm": "t" to the params also works for smaller files that do not raise a prompt, however, I was unable to find much information about this. There may be some cases in which the old method of confirming the prompt through cookies is still required so I didn't remove that.