!!! Important Note !!!
This method doesn't work anymore.
You can download files directly from google drive to your linux VPS using wget command.This method doesn't work anymore.
[/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.
- Make sure Anyone With The Link option is enabled like shown in image below. Then click on Copy Link.
- 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
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
If you have any feedback or question, feel free to leave a comment below.
Last edited: