Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iamtekeste/3cdfd0366ebfd2c0d805 to your computer and use it in GitHub Desktop.
Save iamtekeste/3cdfd0366ebfd2c0d805 to your computer and use it in GitHub Desktop.
Download Google Drive files with WGET
Download Google Drive files with WGET
Example Google Drive download link:
https://docs.google.com/open?id=[ID]
To download the file with WGET you need to use this link:
https://googledrive.com/host/[ID]
Example WGET command:
wget -O file https://googledrive.com/host/[ID]
@LuqmanulGhibran
Copy link

pip install gdown

In terminal:
gdown --id FILEID -O FILENAME

In python:

import gdown

url = 'https://drive.google.com/uc?id=0B9P1L--7Wd2vU3VUVlFnbTgtS2c'
output = 'spam.txt'
gdown.download(url, output, quiet=False)

Can be found HERE

how i can use gdown directly from my command line ?
when i use gdown always command not found

@rafaeldalsenter
Copy link

Tks, @beliys! It worked!

command for download any big file from google drive (for big file we need confirm download)
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

@mwiercioch
Copy link

thanks @beliys, works perfectly!

@hershkoy
Copy link

Only this worked for a 68G file.

are you referring to the answer using IDM?

Worked for me thank you

worked for me too (22GB)

@prabowoekky
Copy link

Only this worked for a 68G file.

are you referring to the answer using IDM?

Worked for me thank you

worked for me too (22GB)

it worked on me, but always stuck and get error message curl: (56) TCP connection reset by peer, anyone can help ? thankyou i've file size 77GB

@eggate
Copy link

eggate commented Apr 23, 2021

Thanks @vladalive still working in 2021 and it's really time saving

@EstudosProjetos
Copy link

obrigado a todos,
wget --no-check-certificate ' https://docs.google.com/uc?export=download&id=FILEID ' -O FILENAME não funcionou para mim para o arquivo .rar, mas adicionar a opção de nova tentativa fez com que funcionasse
isso funcionou. obrigado
wget --no-check-certificate -r ' https://docs.google.com/uc?export=download&id=FILEID ' -O FILENAME

@oguntola2018 perfeito!

Hello @maxsnet and members!

I see many members who report success in the "wget" command.
I’ve been trying for two days and I haven’t succeeded.

The file that is in Google Drive is:
D_mega_2.zip which I also changed to D_mega_2.rar

My shared link to any person is:

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

I made the indicated change and created a batch file conc.bat:

wget --no-check-certificate -r https://docs.google.com/uc?export=download&id=1mZF1PMbzoeUWy6ce_NHpFrRJ9yDz6bou -O D_mega_2.zip

When executing I have the following answer:

--2021-05-27 20: 06: 31-- https://docs.google.com/uc?export=download
Resolving docs.google.com (docs.google.com) ... 2800: 3f0: 4001: 802 :: 200e, 142.250.
219.14
Connecting to docs.google.com (docs.google.com) | 2800: 3f0: 4001: 802 :: 200e |: 443 ...
connected.
HTTP request sent, awaiting response ... 400 Bad Request
2021-05-27 20:06:31 ERROR 400: Bad Request.

They could tell me where I'm going wrong.
If you run the same command line in your browser, the file will always download.

https://docs.google.com/uc?export=download&id=1mZF1PMbzoeUWy6ce_NHpFrRJ9yDz6bou

Thank you all
Marcos Paris

@xinzhel
Copy link

xinzhel commented Jun 11, 2021

Only this worked for a 68G file.

This works for me.

@tuongpgjz
Copy link

command for download any big file from google drive (for big file we need confirm download)
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

This worked for me by changing https://docs.google.com to https://drive.google.com

Yeah, it save my life!

@zihaozhang9
Copy link

zihaozhang9 commented Dec 20, 2021 via email

@zihaozhang9
Copy link

zihaozhang9 commented Jan 20, 2022 via email

@Johnqczhang
Copy link

Only this worked for a 68G file.

This works for a 188G file! Thanks a lot!

@luisnquin
Copy link

@beliys <3

@iolathief108
Copy link

@LL3RD Worked for me

@wangc39
Copy link

wangc39 commented Jun 21, 2022

Only this worked for a 68G file.

This works for a 3.3G file with a so fast speed. Thanks a lot!

@zihaozhang9
Copy link

zihaozhang9 commented Jun 21, 2022 via email

@bhosalems
Copy link

bhosalems commented Jul 18, 2022

How can I download the dataset here https://drive.google.com/drive/folders/0BweDykwS9vIoUG5nNGRjQmFLTGM?resourcekey=0-dHhRVxB0LDUcUVtASUIgTQ
I want to download Stanford3dDataset_v1.2.tar

@zihaozhang9
Copy link

zihaozhang9 commented Jul 18, 2022 via email

@vieirafb
Copy link

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

Thanks, @beliys! It worked perfectly for me.

@zihaozhang9
Copy link

zihaozhang9 commented Oct 30, 2023 via email

Copy link

ghost commented Feb 9, 2024

Why not work, kinda. The file is 886MB but it download its html file...

u0_a227@localhost ~
└─▶ wget --load-cookies $TMPDIR/cookies.txt "https://drive.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies $TMPDIR/cookies.txt --keep-session-cookies --no-check-certificate 'https://drive.google.com/uc?export=download&id=1IPQdFtw6ukMcDfgaxf-qPjtk9Iy34el0' -O- | sed -rn 's/.confirm=([0-9A-Za-z_]+)./\1\n/p')&id=1IPQdFtw6ukMcDfgaxf-qPjtk9Iy34el0" -O glibc.tar.xz && rm -rf $TMPDIR/cookies.txt
--2024-02-09 10:42:51-- https://drive.google.com/uc?export=download&confirm=&id=1IPQdFtw6ukMcDfgaxf-qPjtk9Iy34el0
Resolving drive.google.com (drive.google.com)... 142.251.220.142, 2404:6800:4017:801::200e
Connecting to drive.google.com (drive.google.com)|142.251.220.142|:443... connected.
HTTP request sent, awaiting response... 303 See Other
Location: https://drive.usercontent.google.com/download?id=1IPQdFtw6ukMcDfgaxf-qPjtk9Iy34el0&export=download [following]
--2024-02-09 10:42:51-- https://drive.usercontent.google.com/download?id=1IPQdFtw6ukMcDfgaxf-qPjtk9Iy34el0&export=download
Resolving drive.usercontent.google.com (drive.usercontent.google.com)... 142.251.220.193, 2404:6800:4017:803::2001
Connecting to drive.usercontent.google.com (drive.usercontent.google.com)|142.251.220.193|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2434 (2.4K) [text/html]
Saving to: ‘glibc.tar.xz’

glibc.tar.xz 100%[=================>] 2.38K --.-KB/s in 0.02s

2024-02-09 10:42:53 (115 KB/s) - ‘glibc.tar.xz’ saved [2434/2434]

u0_a227@localhost ~
└─▶

@Ayush-00
Copy link

Only this worked for a 68G file.

This worked for me too! Thanks!

@zihaozhang9
Copy link

zihaozhang9 commented Jul 17, 2024 via email

@surajvarma0090
Copy link

I found a blog article that shows how to download Google Drive files using the Linux terminal. It includes a step-by-step guide and a video. Check it out here.

@zihaozhang9
Copy link

zihaozhang9 commented Jul 31, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment