wget a Google Drive file

Note: this isn’t working, just listing it for reference at this point. It was purported to work.
This posts lists how to get a Google Drive file using wget (and sed and rm).
Copy and paste this into a bash line.
function gdrive_download () { CONFIRM=$(wget –quiet –save-cookies /tmp/cookies.txt –keep-session-cookies –no-check-certificate “https://docs.google.com/uc?export=download&id=$1” -O- | sed -rn ‘s/.confirm=([0-9A-Za-z_]+)./\1\n/p’) wget –load-cookies /tmp/cookies.txt “https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1” -O $2 rm -rf /tmp/cookies.txt }
gdrive_download 120aPYqveqPx6jtssMEnLoqY0kCgVdR2fgMpb8FhFNHo test.txt
These two commands will download the content you see above at link: https://docs.google.com/document/d/120aPYqveqPx6jtssMEnLoqY0kCgVdR2fgMpb8FhFNHo/edit?usp=sharing
For other files use the ID of the file and call grive_download with the ID and what you’d like to name the resulting file:
gdrive_download ID filename.txt
References
-
Drive logo from link.