Download Files From Google Drive Using Wget

downloag files from Google Drive using wget
Written by @kiosmerdeka

You can download files from Google Drive using wget. Before that, you need to know that files in Google Drive are small and large sized.

Files less than 100MB are considered small, where files larger than 100MB are considered large.

The file must be shared publicly before being downloaded.

  1. Select a file that is needed to be downloaded and does right-click.
  2. Click Share. A dialog box will appear.
  3. Click Advanced in the right bottom corner.
  4. Click on the Change.. under who has access.
  5. Make it On- Public on the web.
  6. Click the Save button.
  7. Copy the link for sharing, something like …
    https://drive.google.com/file/d/1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA/view?usp=sharing
  8. Extrac FILEID part like….from above…. 1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

In the above command change the FILEID by above id extracted and rename FILENAME (with extension) for your own simple use.

For large file run the following command with necessary changes in FILEID and FILENAME:

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 FILENAME && rm -rf /tmp/cookies.txt

That’s it.

Baca juga  Reset MySQL Root Password How to ( On Ubuntu Server OS )

Leave a Comment