Skip to content

Instantly share code, notes, and snippets.

@lvzongting
Last active September 20, 2019 03:51
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save lvzongting/0f367ded8d4adbac3ed06d4d43e8d50d to your computer and use it in GitHub Desktop.
Save lvzongting/0f367ded8d4adbac3ed06d4d43e8d50d 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