Skip to content

Instantly share code, notes, and snippets.

@amorev
Last active October 17, 2019 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amorev/24e1e6eaabdda1cf30722ec77ce3a9ee to your computer and use it in GitHub Desktop.
Save amorev/24e1e6eaabdda1cf30722ec77ce3a9ee to your computer and use it in GitHub Desktop.
Wget file from Google Drive
# Change FILE_ID to ID of File in google drive.
# Change FILE_NAME to File name, which you want to use for save file
FILE_ID=FILE_ID FILE_NAME=FILE_NAME wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=$FILE_ID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=$FILE_ID" -O $FILE_NAME && rm -rf /tmp/cookies.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment