Expired How to download files from Google Drive using wget on Linux VPS ?

Status
Not open for further replies.

Vertigo

⍥????
Staff member
Administrator
!!! Important Note !!!
This method doesn't work anymore
.
You can download files directly from google drive to your linux VPS using wget command.
[/center]
For this to work, make sure public access is enabled for the file you are downloading. To do this,
  • Navigate to google drive and right click on the file, then click on Get Link option.
    717
  • Make sure Anyone With The Link option is enabled like shown in image below. Then click on Copy Link.
    719
  • Now copy the File ID from the link which you copied in above step. Below is one example :
    Link : https://drive.google.com/file/d/19IwTcJXgopvsycTVAo8JtgZLISTvR-dP/view?usp=sharing
    So the File ID in above link is : 19IwTcJXgopvsycTVAo8JtgZLISTvR-dP
  • We will use this File ID in wget command to download the file.

For files under 100 MB in size, use below command :

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

Replace FILEID with File ID which we mentioned above (Example : 19IwTcJXgopvsycTVAo8JtgZLISTvR-dP).
Replace FILENAME with name of the file. (Example: file.zip)

So now the above command will look like this :

Bash:
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=19IwTcJXgopvsycTVAo8JtgZLISTvR-dP' -O file.zip
For files larger than 100 MB in size, use below 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=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt

Replace FILEID with File ID which we mentioned above (Example : 19IwTcJXgopvsycTVAo8JtgZLISTvR-dP).
Replace FILENAME with name of the file. (Example: file.zip)

So now the above command will look like this :

Bash:
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=19IwTcJXgopvsycTVAo8JtgZLISTvR-dP' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=19IwTcJXgopvsycTVAo8JtgZLISTvR-dP" -O file.zip && rm -rf /tmp/cookies.txt
That's it !! The file should be downloaded.
If you have any feedback or question, feel free to leave a comment below.
 
Last edited:

kushal

Anti-Bulle People
Staff member
Content Writer
Bash:
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
For Files Bigger and needs confirmation I think this works cause for me it just makes a random Folders (File was 1.8GB)

UPDATE : Still Doesn't works LOL
 
Last edited:

Vertigo

⍥????
Staff member
Administrator
Cannot open cookies file ‘/tmp/cookies.txt’: No such file or directory
Run the command as root user.
Make sure to check if read/write/execute permission is ON in tmp folder.
 

Vertigo

⍥????
Staff member
Administrator
What are you giving in FILENAME parameter ?
And what is the result you got ? Attach screenshots.
 
Status
Not open for further replies.
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock