Created
August 5, 2020 16:05
-
-
Save turkeryildirim/c22cff09e66149866d9dacf81c937dbb to your computer and use it in GitHub Desktop.
google docs file downloader
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
#!/bin/bash | |
# Get files from Google Drive | |
# $1 = file ID | |
# $2 = file name | |
URL="https://docs.google.com/uc?export=download&id=$1" | |
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 $URL -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=$1" -O $2 && rm -rf /tmp/cookies.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment