Last active
March 12, 2020 14:41
-
-
Save bkj/cf0d8a213eb9159c04558b0e26923a8c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function download_google_drive { | |
SRC=$1 | |
DST=$2 | |
echo "$SRC -> $DST" | |
curl -c /tmp/cookies "https://drive.google.com/uc?export=download&id=$SRC" > /tmp/intermezzo.html | |
DL_LINK=$(cat /tmp/intermezzo.html |\ | |
grep -Po 'uc-download-link" [^>]* href="\K[^"]*' |\ | |
sed 's/\&/\&/g' | |
) | |
curl -L -b /tmp/cookies https://drive.google.com$DL_LINK > $DST | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment