Created
April 13, 2020 13:02
-
-
Save harish2704/bfb8abece94893c53ce344548ead8ba5 to your computer and use it in GitHub Desktop.
Download publicly accessible files from google drive using 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
#!/usr/bin/env bash | |
urlBase='https://drive.google.com' | |
fCookie=tmpcookies | |
curl="curl -L -b $fCookie -c $fCookie" | |
confirm(){ | |
$curl "$1" | grep jfk-button-action | sed -e 's/.*jfk-button-action" href="\(\S*\)".*/\1/' -e 's/\&/\&/g' | |
} | |
$curl -O -J "${urlBase}$(confirm $1)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment