How to Download Google Drive files with WGET Linux (Tiny and Big File Size)

Posted on

How to Download Google Drive files with WGET – If you need to update Claymore remotely (i.e., there is no physical access to your mining rig’s USB ports), the following options allow you to download Google Drive files via the command line in 1 line of code.

How to Download Google Drive files with WGET Linux

Note: These scenarios work on publicly shared Google Drive links, where no user authentication is required (Public share).

 

Option 1. Download “Non-Large/Tiny” Google Drive Files

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

Example WGET command:

wget –no-check-certificate ‘https://docs.google.com/uc?export=download&id=AbcDefgHijklMnOPQ‘ -O backup.zip

 

Option 2. Download Very Large Google Drive Files

For large files, google drive requires a download confirm code, which is stored in a cookie. See this StackOverflow solution for details

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_]+).*/1n/p’)&id=FILEID” -O FILENAME && rm -rf /tmp/cookies.txt

Example WGET 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=AbcDefgHijklMnOPQ‘ -O- | sed -rn ‘s/.*confirm=([0-9A-Za-z_]+).*/1n/p’)&id=AbcDefgHijklMnOPQ” -O backup.zip && rm -rf /tmp/cookies.txt