Last active
August 10, 2018 09:37
-
-
Save xhdix/ec10f6429984bc59371f9584663c3437 to your computer and use it in GitHub Desktop.
Google Drive/Docs any big 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 | |
##orginal: https://gist.github.com/iamtekeste/3cdfd0366ebfd2c0d805#gistcomment-2359248 | |
##alternative: https://jl-workshop.com/Cloud-Storage-Direct-Link-Generator/ | |
##command: | |
## bash gddl.sh subdomain_name(drive|docs) long_google_drive_file_id filename.ext | |
CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://$1.google.com/uc?export=download&id=$2" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p') | |
wget --load-cookies /tmp/cookies.txt "https://$1.google.com/uc?export=download&confirm=$CONFIRM&id=$2" -O $3 | |
rm -rf /tmp/cookies.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment