Using wget to download files from Google Drive

Using wget to download files from Google Drive

Step 1. Go to Google Drive and right-click on the file that you wish to download, then go to Share

Step 2. Click the Change button at the bottom of the dialog box to Anyone

Step 3. Copy the link and from it simply take the FILEID:

https://drive.google.com/file/d/ 1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA /view?usp=sharing

Step 4. Change the FILEID in this snippet and run it:

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 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O backup.zip && rm -rf /tmp/cookies.txt
whoami
Nikola Markovic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.