https://www.matthuisman.nz/2019/01/download-google-drive-files-wget-curl.html
Last active
March 29, 2020 04:08
-
-
Save mchoiruln/f094a595f8a9ac33e0a105227b07d4b8 to your computer and use it in GitHub Desktop.
Download Google Drive Files With WGET or CURL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~ | |
export fileid=1sNhrr2u6n48vb5xuOe8P9pTayojQoOc_ | |
export filename=file | |
## WGET ## | |
wget --save-cookies cookies.txt 'https://docs.google.com/uc?export=download&id='$fileid -O- \ | |
| sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1/p' > confirm.txt | |
wget --load-cookies cookies.txt -O $filename \ | |
'https://docs.google.com/uc?export=download&id='$fileid'&confirm='$(cat confirm.txt) | |
## CURL ## | |
curl -L -c cookies.txt 'https://docs.google.com/uc?export=download&id='$fileid \ | |
| sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1/p' > confirm.txt | |
curl -L -b cookies.txt -o $filename \ | |
'https://docs.google.com/uc?export=download&id='$fileid'&confirm='$(cat confirm.txt) | |
rm -f confirm.txt cookies.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~ | |
export fileid=1yXsJq7TTMgUVXbOnCalyupESFN-tm2nc | |
export filename=file | |
## WGET ## | |
wget -O $filename 'https://docs.google.com/uc?export=download&id='$fileid | |
## CURL ## | |
curl -L -o $filename 'https://docs.google.com/uc?export=download&id='$fileid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment