Skip to content

Instantly share code, notes, and snippets.

@M2shad0w
Forked from lvzongting/wget-gdrive.sh
Created May 3, 2018 12:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save M2shad0w/277f87dac0f03b7ef7e54bf0b8e35905 to your computer and use it in GitHub Desktop.
Save M2shad0w/277f87dac0f03b7ef7e54bf0b8e35905 to your computer and use it in GitHub Desktop.
download google drive file only with wget 仅通过wget 在bash命令行下载谷歌网盘(狗哥网盘)上的文件
#reference https://unix.stackexchange.com/questions/136371/how-to-download-a-folder-from-google-drive-using-terminal
#get cookie and code
wget --save-cookies 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_]+).*/Code: \1\n/p'
#download the file
wget --load-cookies cookies.txt 'https://docs.google.com/uc?export=download&confirm=CODE_FROM_ABOVE&id=FILEID'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment