Skip to content

Instantly share code, notes, and snippets.

@aculich
Forked from amit-chahar/download-script.sh
Created December 6, 2018 10:32
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 aculich/d966b2a574131d4731028825c976fc8e to your computer and use it in GitHub Desktop.
Save aculich/d966b2a574131d4731028825c976fc8e to your computer and use it in GitHub Desktop.
Scirpt to download files from Google drive using curl (Detailed explanation can be read here: https://stackoverflow.com/a/49444877/4043524)
#!/bin/bash
fileid="FILEIDENTIFIER"
filename="FILENAME"
curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null
curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o ${filename}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment