Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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]
@chupzzz

This comment has been minimized.

Copy link

chupzzz commented Jul 19, 2017

It doesn't works as for 2017

@msn100001

This comment has been minimized.

Copy link

msn100001 commented Jul 27, 2017

This seems to work for one file.

wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

@pzyxian

This comment has been minimized.

Copy link

pzyxian commented Sep 1, 2017

still don't work somehow. I can't download a zip file with
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

@Kjeanclaude

This comment has been minimized.

Copy link

Kjeanclaude commented Oct 2, 2017

This doesn't work for me too. It seems that these download methods are obsolete.

@ABouenard

This comment has been minimized.

Copy link

ABouenard commented Oct 24, 2017

Good to know. Did you find any work-around? Thanks

@naufdotal

This comment has been minimized.

Copy link

naufdotal commented Oct 29, 2017

thanks, i can download the rar with
wget --no-check-certificate 👍

@gabrielstuff

This comment has been minimized.

Copy link

gabrielstuff commented Dec 18, 2017

wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME works perfectly for publicly shared link.
Thanks ! 👍

@beliys

This comment has been minimized.

Copy link

beliys commented Jan 10, 2018

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

@eltonplima

This comment has been minimized.

Copy link

eltonplima commented Jan 11, 2018

Thanks @beliys! Works perfectly!!

@luandro

This comment has been minimized.

Copy link

luandro commented Jan 24, 2018

Thanks for sharing. @beliys seems to work for files, but how do I make it work for a folder?

@murari023

This comment has been minimized.

Copy link

murari023 commented Feb 1, 2018

Yes, this solution is working. Thank you @beliys

@mtarekcse

This comment has been minimized.

Copy link

mtarekcse commented Feb 11, 2018

@beliys
Thanks

@sxs4337

This comment has been minimized.

Copy link

sxs4337 commented Feb 20, 2018

@beliys
It worked fine for a single large file. Thanks.

@simmimourya

This comment has been minimized.

Copy link

simmimourya commented Feb 21, 2018

Works for a single large file :) Thanks! Saved my day.

@vladalive

This comment has been minimized.

Copy link

vladalive commented Feb 22, 2018

I've used @beliys code and made a bash command.

Setup:

  1. Add this code to your ~/.bash_aliases file.
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
}
  1. Open new bash session.

Usage:

gdrive_download long_google_drive_file_id filename.ext
@david2921

This comment has been minimized.

Copy link

david2921 commented Feb 23, 2018

thank @vladalive

@mrandri19

This comment has been minimized.

Copy link

mrandri19 commented Feb 24, 2018

thanks @vladalive

@RahulModi

This comment has been minimized.

Copy link

RahulModi commented Mar 3, 2018

Thank you @beliys

work perfect
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

@mehdiahmed58

This comment has been minimized.

Copy link

mehdiahmed58 commented Mar 3, 2018

hi say me .. !! whats problem plz !!
capture

@Italjapan

This comment has been minimized.

Copy link

Italjapan commented Mar 13, 2018

thanks @vladalive

@kstoriadis

This comment has been minimized.

Copy link

kstoriadis commented Mar 16, 2018

thanks @vladalive you are my only hero in this mess

@MaigoAkisame

This comment has been minimized.

Copy link

MaigoAkisame commented Mar 28, 2018

Thanks @beliys, it worked! (03/28/2018)

@ccfiel

This comment has been minimized.

Copy link

ccfiel commented Apr 2, 2018

@beliys thanks!!! 💃

@vfdev-5

This comment has been minimized.

Copy link

vfdev-5 commented Apr 8, 2018

Thanks @beliys and @vladalive !

@yacineblr

This comment has been minimized.

Copy link

yacineblr commented Apr 9, 2018

Thanks @beliys @vladalive !!!!

@zdrav1

This comment has been minimized.

Copy link

zdrav1 commented Apr 12, 2018

Thank you @beliys ! Works like a charm . I added also --user=username and --password='xxxxxx' and it works if File Link sharing is set 'on'
in google drive

@rokibhasansagar

This comment has been minimized.

Copy link

rokibhasansagar commented Apr 26, 2018

Thank You @beliys
It works !

@DiegoIdeas

This comment has been minimized.

Copy link

DiegoIdeas commented May 5, 2018

Hi based on this comments ... i create a bash to export a list of URL from file URLS.text to a URLS_DECODED.txt
an used in some accelerator like flashget ( i use cygwin to combine windows & linux )

Command spider was introduced to avoid download and get the final link ( directly )

Command GREP HEAD and CUT, process and get the final link, Is based in spanish language, maybe you could be port to ENGLISH LANGUAGE

echo -e "$URL_TO_DOWNLOAD\r" probably the \r is only cywin and must be replace by a \n (break line)
**********user*********** is the user folder
*******Localización*********** is in spanish language, clear the asterics and let the word in english Location and adapt THE HEAD and the CUT numbers to appropiate approach.


rm -rf /home/**********user***********/URLS_DECODED.txt
COUNTER=0
while read p; do 
	string=$p
    hash="${string#*id=}"
    hash="${hash%&*}"
    hash="${hash#*file/d/}"
    hash="${hash%/*}"
    let COUNTER=COUNTER+1
    echo "Enlace "$COUNTER" id="$hash
    URL_TO_DOWNLOAD=$(wget --spider --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='$hash -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id="$hash 2>&1 | grep *******Localización***********: | head -c-13 | cut -c16-)
    rm -rf /tmp/cookies.txt
    echo -e "$URL_TO_DOWNLOAD\r" >> /home/**********user***********/URLS_DECODED.txt
    echo "Enlace "$COUNTER" URL="$URL_TO_DOWNLOAD
done < /home/**********user***********/URLS.txt```
@OneCDOnly

This comment has been minimized.

Copy link

OneCDOnly commented May 11, 2018

@beliys, another happy camper here. Good work! 👍

@mutegdp

This comment has been minimized.

Copy link

mutegdp commented May 15, 2018

Thank you @beliys , its works

@SpJam

This comment has been minimized.

Copy link

SpJam commented May 16, 2018

Thanks @vladalive and @beliys !!

Download from local to Azure 5MB/s
Download from Google to Azure 172MB/s

very long time saved!

@shermster

This comment has been minimized.

Copy link

shermster commented May 21, 2018

Thanks @beliys! Works perfectly.

@louisophie

This comment has been minimized.

Copy link

louisophie commented Jun 6, 2018

Thanks so much.^_^

@NOOYA

This comment has been minimized.

Copy link

NOOYA commented Jun 11, 2018

Thanks @beliys

@hexbinoct

This comment has been minimized.

Copy link

hexbinoct commented Jun 16, 2018

what I got from google drive (shareable link) was this:
https://drive.google.com/open?id=ID
changed it to:
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=ID' -O FILENAME

after this you will get a file named FILENAME in the directory, rename it to your liking.

@glennparris

This comment has been minimized.

Copy link

glennparris commented Jul 18, 2018

This is what I use to get a file available as a linked file from googledrive using a Batch file
I use a lot of parameters but it always works. I've explained the parameters below.
Used Escape charaters (^) used because of the batch file

Find and use the proper filename (--content-disposition)
Into a directory called c:\mydirectory\temp (--directory-prefix=^"c:\mydirectory\temp^")
Try 10 times for a successful download (--tries=10)
Don't check for a certificate (--no-check-certificate)
Give me full error listing (nv)
Put the error listing in a file called c:\reports\YY.MM.DD_wget.txt
(--append-output=c:\reports%date:-4,4%.%date:-7,2%.%date:~-10,2%_wget.txt)
Finally
Run wget command (Wgwet https://drive.google.com/uc?export=download^&id= ????????????????????)

So single full line is below:

wget.exe --content-disposition --directory-prefix=^"c:\mydirectory\temp^" --tries=10 --no-check-certificate -nv --append-output=c:\reports%date:-4,4%.%date:-7,2%.%date:~-10,2%_wget.txt https://drive.google.com/uc? export=download^&id=???????????????????????????????

@dshamaeli

This comment has been minimized.

Copy link

dshamaeli commented Aug 3, 2018

thank you @beliys

@abumaryam

This comment has been minimized.

Copy link

abumaryam commented Aug 5, 2018

Thanks @vladalive and @beliys it works

@purbojati

This comment has been minimized.

Copy link

purbojati commented Aug 6, 2018

anyone who don't understand @beliys . He it is you must change FILEID with your Google Drive file ID. It appear in URL. Also FILENAME change with your new file name. Be sure to include extension like .zip 💯

@kingsj0405

This comment has been minimized.

Copy link

kingsj0405 commented Aug 15, 2018

@vladalive nice work!

@oguntola2018

This comment has been minimized.

Copy link

oguntola2018 commented Aug 20, 2018

thanks you all,
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME didnt work for me for .rar file but adding thr retry option got it working

this worked. thanks
wget --no-check-certificate -r 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

@GitHub30

This comment has been minimized.

Copy link

GitHub30 commented Aug 28, 2018

curl gdrive.sh | bash -s FILEID

https://github.com/GitHub30/gdrive.sh

@bhollan

This comment has been minimized.

Copy link

bhollan commented Sep 3, 2018

Thanks to all! @beliys, @vladalive, and @GitHub30!

@Gibigbig

This comment has been minimized.

Copy link

Gibigbig commented Sep 15, 2018

thanks you all,
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME didnt work for me for .rar file but adding thr retry option got it working

this worked. thanks
wget --no-check-certificate -r 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

thanks this worked 2018

@marcelofeb

This comment has been minimized.

Copy link

marcelofeb commented Sep 18, 2018

Thanks!
But i have one question, someone know how download large files in wget for Windows?
i try alot command whitout success.

@mzramna

This comment has been minimized.

Copy link

mzramna commented Sep 20, 2018

https://github.com/mzramna/easy-google-drive-downloader this one i've made uses the upper logics with sed to make it easyer to be used,but in future i will update it to python and give more functionality

@mzramna

This comment has been minimized.

Copy link

mzramna commented Sep 20, 2018

Thanks!
But i have one question, someone know how download large files in wget for Windows?
i try alot command whitout success.

nowdays you can download ubuntu(or other linux) terminal into windows 10 appstore ,so just use those codes into it

@MaxLing

This comment has been minimized.

Copy link

MaxLing commented Oct 4, 2018

thanks @vladalive and @beliys

@HuaxuanGAO

This comment has been minimized.

Copy link

HuaxuanGAO commented Oct 11, 2018

Thanks @vladalive!
Solution given by @beliys reports illegal variable name, no idea why

@pavanjadhaw

This comment has been minimized.

Copy link

pavanjadhaw commented Oct 20, 2018

gdown

I am able to download large files from gdrive using this perl script.
You can pass the filelink and filname to it.

wget https://raw.githubusercontent.com/pavanjadhaw/gdown.pl/master/gdown.pl && chmod u+x gdown.pl

then

./gdown.pl "link to file" file.mp4

@haghshenas

This comment has been minimized.

Copy link

haghshenas commented Oct 22, 2018

@tall-josh

This comment has been minimized.

Copy link

tall-josh commented Nov 4, 2018

Thanks @beliys and @vladalive !

@andrea-simonelli-research

This comment has been minimized.

Copy link

andrea-simonelli-research commented Nov 9, 2018

gdown

I am able to download large files from gdrive using this perl script.
You can pass the filelink and filname to it.

wget https://raw.githubusercontent.com/pavanjadhaw/gdown.pl/master/gdown.pl && chmod u+x gdown.pl

then

./gdown.pl "link to file" file.mp4

This worked for me! I noticed that in @haghshenas 's answer (https://stackoverflow.com/a/32441141/2345493) you must allow the owner of the code to do whatever he wants to your google drive account. I prefer not do do that! This script does the job without risks.

@Space7Panda

This comment has been minimized.

Copy link

Space7Panda commented Nov 19, 2018

@munaAchyuta

This comment has been minimized.

Copy link

munaAchyuta commented Nov 21, 2018

@inishchith

This comment has been minimized.

Copy link

inishchith commented Jan 14, 2019

@hongsukchoi

This comment has been minimized.

Copy link

hongsukchoi commented Feb 21, 2019

for mac users,

change sed to gsed

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- | gsed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt

@guysmoilov

This comment has been minimized.

Copy link

guysmoilov commented Feb 28, 2019

Had to modify it slightly to work on Mac AND google drive instead of docs: https://gist.github.com/guysmoilov/ff68ef3416f99bd74a3c431b4f4c739a

@xuannianc

This comment has been minimized.

Copy link

xuannianc commented Mar 8, 2019

@vladalive and @beliys, thank you guys.

@khnwr

This comment has been minimized.

Copy link

khnwr commented Mar 13, 2019

terimakasih

@nbckr

This comment has been minimized.

Copy link

nbckr commented Mar 27, 2019

thanks @vladalive and @beliys

@harrisonyi

This comment has been minimized.

Copy link

harrisonyi commented Mar 28, 2019

thanks you all,
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME didnt work for me for .rar file but adding thr retry option got it working

this worked. thanks
wget --no-check-certificate -r 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

thanks for my .zip file

@novioleo

This comment has been minimized.

Copy link

novioleo commented Mar 29, 2019

thks for @vladalive

@frmoronari

This comment has been minimized.

Copy link

frmoronari commented Apr 5, 2019

thx @GitHub30
Very nice!

@cronfy

This comment has been minimized.

Copy link

cronfy commented Apr 22, 2019

thanks @vladalive, it worked!

@zeeshansayyed

This comment has been minimized.

Copy link

zeeshansayyed commented May 7, 2019

thanks @vladalive and @beliys
This problem was driving me crazy for a long time.

@vladalive

This comment has been minimized.

Copy link

vladalive commented May 16, 2019

@vladalive

This comment has been minimized.

Copy link

vladalive commented May 16, 2019

@divyam-goel

This comment has been minimized.

Copy link

divyam-goel commented May 22, 2019

thank you @beliys

@ChandanVerma

This comment has been minimized.

Copy link

ChandanVerma commented May 28, 2019

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

works for me too... Thanks :)

@Harrypotterrrr

This comment has been minimized.

Copy link

Harrypotterrrr commented May 30, 2019

Hi, there is still a problem with @beliys solution:
Take this large file as an example: link is here https://drive.google.com/uc?id=0B_B_FOgPxgFLRjdEdE9NNTlzUWc
I use the following command,

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=0B_B_FOgPxgFLRjdEdE9NNTlzUWc' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=0B_B_FOgPxgFLRjdEdE9NNTlzUWc" -O myfile.mat

Note that I delete && rm -rf /tmp/cookie since I have no permission to delete the file in /tmp
Then I fetch a html file rather than my target large file.
So can anyone help me to figure it out? (btw, I use @GitHub30 solution, and it works! Appreciate very much!)

@siamware

This comment has been minimized.

Copy link

siamware commented Jun 1, 2019

wget --load-cookies cookies.txt "https://drive.google.com/uc?authuser=0&id=$1&export=download" -O $2
it work

@eduardoalthaus

This comment has been minimized.

Copy link

eduardoalthaus commented Jun 5, 2019

thanks you all,
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME didnt work for me for .rar file but adding thr retry option got it working

this worked. thanks
wget --no-check-certificate -r 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

Great! It worked.
Thanks.

@MittalShruti

This comment has been minimized.

Copy link

MittalShruti commented Jun 12, 2019

Thank You @beliys !!

@mikeguidry

This comment has been minimized.

Copy link

mikeguidry commented Jun 14, 2019

I've made some mods.. The current one was failing on a slow connection after awhile with a google returned text/html page (confirmation, or cookie expire, or something)... This one has some redundancy, and verifies the download on resume...
https://gist.github.com/mikeguidry/8bf7b2116f92978fb02283035b9ddb81
:)
give all credit to original authors... they did the hard part (getting cookie, etc)

Edit: oh mine also allows setting bandwidth by..
gdrive_dl BW:100 gdrive_id output.zip

@zihaozhang9

This comment has been minimized.

Copy link

zihaozhang9 commented Jun 14, 2019

从谷歌驱动器下载任何大文件的命令(对于大文件,我们需要确认下载)
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

Sorry! I don't seem to be able to use the command. Can you help me?

mini_imagenet_test.pickle in https://drive.google.com/drive/folders/15WuREBvhEbSWo4fTr1r-vMY0C_6QWv4w
FILEID = 1XyjEGP8IaQ8fZ4rsPndqbB1mg1sZZmKP

I use 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=1XyjEGP8IaQ8fZ4rsPndqbB1mg1sZZmKP" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=1XyjEGP8IaQ8fZ4rsPndqbB1mg1sZZmKP" -O FILENAME && rm -rf /tmp/cookies.txt

log:--2019-06-14 22:32:01-- https://docs.google.com/uc?export=download&confirm=8Q06&id=1XyjEGP8IaQ8fZ4rsPndqbB1mg1sZZmKP Resolving docs.google.com (docs.google.com)... 216.58.200.78, 2404:6800:4005:811::200e Connecting to docs.google.com (docs.google.com)|216.58.200.78|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: 'FILENAME' FILENAME [ <=> ] 3.21K --.-KB/s in 0.003s 2019-06-14 22:32:02 (1.15 MB/s) - 'FILENAME' saved [3290]

The file I downloaded is only 4kb

@mikeguidry

This comment has been minimized.

Copy link

mikeguidry commented Jun 15, 2019

You received thehtml/text problem I had ran into.. check out my version. It checks for that before saving to the file, or overwriting the resume file..
https://gist.github.com/mikeguidry/8bf7b2116f92978fb02283035b9ddb81

@zihaozhang9

This comment has been minimized.

Copy link

zihaozhang9 commented Jun 15, 2019

你收到我遇到的HTML /文本问题..看看我的版本。它会在保存到文件之前检查,或者覆盖恢复文件..
https://gist.github.com/mikeguidry/8bf7b2116f92978fb02283035b9ddb81

Thank you very much. I am using bash command : gdrive_dl.sh 1XyjEGP8IaQ8fZ4rsPndqbB1mg1sZZmKP mini_imagenet_test.pickle

The following log is printed cyclically. I think maybe it’s my network connection problem.
log:


--2019-06-15 10:51:13-- https://docs.google.com/uc?export=download&confirm=lP3z&id=1XyjEGP8IaQ8fZ4rsPndqbB1mg1sZZmKP
Resolving docs.google.com (docs.google.com)... 172.217.161.174, 2404:6800:4005:80f::200e
Connecting to docs.google.com (docs.google.com)|172.217.161.174|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'ab2ce63b3c7e0a8c09028e11cc9a6cee.tmp'
0K .......... .......... .......... .......... 167K=0.2s
2019-06-15 10:51:13 (167 KB/s) - 'ab2ce63b3c7e0a8c09028e11cc9a6cee.tmp' saved [41793]


--2019-06-15 10:51:14-- https://docs.google.com/uc?export=download&confirm=sWSi&id=1XyjEGP8IaQ8fZ4rsPndqbB1mg1sZZmKP
Resolving docs.google.com (docs.google.com)... 172.217.161.174, 2404:6800:4005:80f::200e
Connecting to docs.google.com (docs.google.com)|172.217.161.174|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: 'ab2ce63b3c7e0a8c09028e11cc9a6cee.tmp'
0K .......... .......... .......... .......... 173K=0.2s
2019-06-15 10:51:15 (173 KB/s) - 'ab2ce63b3c7e0a8c09028e11cc9a6cee.tmp' saved [41793]


@mikeguidry

This comment has been minimized.

Copy link

mikeguidry commented Jun 15, 2019

You seem to be getting the html/text response back continuously... I've tested your file here: https://drive.google.com/file/d/1XyjEGP8IaQ8fZ4rsPndqbB1mg1sZZmKP/edit
It exists..
mike@i  ~  gdrive_dl 1XyjEGP8IaQ8fZ4rsPndqbB1mg1sZZmKP mini_imagenet_test.pickle  ✔  10113  01:29:39
--2019-06-15 01:29:49-- https://docs.google.com/uc?export=download&confirm=SdRG&id=1XyjEGP8IaQ8fZ4rsPndqbB1mg1sZZmKP
Resolving docs.google.com (docs.google.com)... 172.217.14.174, 2607:f8b0:4000:816::200e
Connecting to docs.google.com (docs.google.com)|172.217.14.174|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://doc-0c-14-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/721ncci4vpbe37o6g7bcoc7vocun86a0/1560571200000/03442058075182384827/*/1XyjEGP8IaQ8fZ4rsPndqbB1mg1sZZmKP?e=download [following]
Warning: wildcards not supported in HTTP.
--2019-06-15 01:29:49-- https://doc-0c-14-docs.googleusercontent.com/docs/securesc/ha0ro937gcuc7l7deffksulhg5h7mbp1/721ncci4vpbe37o6g7bcoc7vocun86a0/1560571200000/03442058075182384827/*/1XyjEGP8IaQ8fZ4rsPndqbB1mg1sZZmKP?e=download
Resolving doc-0c-14-docs.googleusercontent.com (doc-0c-14-docs.googleusercontent.com)... 172.217.1.225, 2607:f8b0:4000:802::2001
Connecting to doc-0c-14-docs.googleusercontent.com (doc-0c-14-docs.googleusercontent.com)|172.217.1.225|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/octet-stream]
Saving to: ‘ab2ce63b3c7e0a8c09028e11cc9a6cee.tmp’

 0K .......... .......... .......... .......... .......... 26.2K
50K .......... .......... .......... .......... .......... 14.1K

100K .......... .......... .......... .......... .......... 17.1K
150K .......... .......... .......... .......... .......... 20.0K

works fine here... it must be something with google and your source ip address for some reason? I cannot think of any other reasoning honestly... maybe your locale could have different variable names for the confirmation? no clue... =/

@sudoCode123

This comment has been minimized.

Copy link

sudoCode123 commented Jul 31, 2019

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

Works like a charm! Thanks man!

@ffabi

This comment has been minimized.

Copy link

ffabi commented Jul 31, 2019

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

Works perfectly, thanks!

@ellieandallen

This comment has been minimized.

Copy link

ellieandallen commented Aug 20, 2019

thanks you all,
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME didnt work for me for .rar file but adding thr retry option got it working

this worked. thanks
wget --no-check-certificate -r 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

wow this worked,thank you for your sharing

@osuzdalev

This comment has been minimized.

Copy link

osuzdalev commented Aug 20, 2019

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

@latinofac

This comment has been minimized.

Copy link

latinofac commented Aug 29, 2019

Thank You @beliys !!

One detail:

  • It works only if the file is on your drive, and not in a subfolder.
@Jostino

This comment has been minimized.

Copy link

Jostino commented Sep 2, 2019

thanks @beliys and @vladalive
it's working

@dadodasyra

This comment has been minimized.

Copy link

dadodasyra commented Sep 4, 2019

wget --no-check-certificate -r 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

Work on 2019 on Debian 9 in no root user

@War3Evo

This comment has been minimized.

Copy link

War3Evo commented Sep 5, 2019

What if you need to stop the download and resume it?

@sreekanthraju999

This comment has been minimized.

Copy link

sreekanthraju999 commented Sep 9, 2019

Thank you @beliys

@pidugusundeep

This comment has been minimized.

Copy link

pidugusundeep commented Sep 12, 2019

thanks, @beliys it works just fine for a file.

@r10a

This comment has been minimized.

Copy link

r10a commented Sep 17, 2019

Thanks, @dadodasyra. I had to go root on Ubuntu 1604 though. Not sure if it was a problem on my side.

@wj-zhang

This comment has been minimized.

Copy link

wj-zhang commented Sep 20, 2019

Thanks a lot, @beliys

@crazygit

This comment has been minimized.

Copy link

crazygit commented Sep 29, 2019

Thanks @beliys! Works perfectly!!!!!

@tensarflow

This comment has been minimized.

Copy link

tensarflow commented Oct 8, 2019

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

Thank youuuuuuuuu

@qasimmughal0

This comment has been minimized.

Copy link

qasimmughal0 commented Nov 18, 2019

Hi All,
I'm facing an error during verify the GDrive app on google account.
Can anyone guide me on how can I fix that? I'm using windows platform
Google Drive

@alex-tifox

This comment has been minimized.

Copy link

alex-tifox commented Dec 8, 2019

thanks you all,
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME didnt work for me for .rar file but adding thr retry option got it working

this worked. thanks
wget --no-check-certificate -r 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

This worked for me in 2019. Thanks a lot!

@kikegoni

This comment has been minimized.

Copy link

kikegoni commented Dec 13, 2019

Hey, I have a .xlsx file and I have done also this:

wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

But obtaining this error:

HTTP request sent, awaiting response... 404 Not Found
2019-12-13 10:27:02 ERROR 404: Not Found.

Has anyone experienced a similar error? It's weird because when I have tried with other files only owned by me it works but with these shared files it is giving this error.

Any help would be appreciated.

@pidugusundeep

This comment has been minimized.

Copy link

pidugusundeep commented Dec 13, 2019

@kikegoni

Hey, I have a .xlsx file and I have done also this:

wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

But obtaining this error:

HTTP request sent, awaiting response... 404 Not Found
2019-12-13 10:27:02 ERROR 404: Not Found.

Has anyone experienced a similar error? It's weird because when I have tried with other files only owned by me it works but with these shared files it is giving this error.

Any help would be appreciated.

You can try this python module if you have python installed ( https://pypi.org/project/googleDriveFileDownloader/ ). or please post the file id so that we can help you give the URL for the file to download.

@kikegoni

This comment has been minimized.

Copy link

kikegoni commented Dec 13, 2019

Hey @pidugusundeep,

I have just figured it out. Probably it was because it is a google spreadsheet. It worked with:

wget --no-check-certificate 'https://docs.google.com/spreadsheets/export?format=xlsx&id=FILEID' -O FILENAME
@dxb22abad

This comment has been minimized.

Copy link

dxb22abad commented Dec 15, 2019

not working for now

` 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=1bLRrBakT_fe_qRwu7DrAiSAM3Iw6AiaG' -O- | sed -rn 's/.confirm=([0-9A-Za-z_]+)./\1\n/p')&id=1bLRrBakT_fe_qRwu7DrAiSAM3Iw6AiaG" -O test && rm -rf /tmp/cookies.txt
--2019-12-15 16:01:36-- https://docs.google.com/uc?export=download&confirm=&id=1bLRrBakT_fe_qRwu7DrAiSAM3Iw6AiaG
Resolving docs.google.com (docs.google.com)... 64.233.165.194, 2a00:1450:4010:c08::c2
Connecting to docs.google.com (docs.google.com)|64.233.165.194|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘test’

test [ <=> ] 3.03K --.-KB/s in 0s

2019-12-15 16:01:37 (32.9 MB/s) - ‘test’ saved [3098]`

@aduartebdsol

This comment has been minimized.

Copy link

aduartebdsol commented Jan 23, 2020

wget --no-check-certificate -r 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME

This works for me in 2020 hehe, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.