Skip to content

Instantly share code, notes, and snippets.

@thanhleviet
Forked from lvzongting/wget-gdrive.sh
Created August 28, 2017 06:46
Show Gist options
  • Save thanhleviet/33832dcafe7464deed53901fe7190920 to your computer and use it in GitHub Desktop.
Save thanhleviet/33832dcafe7464deed53901fe7190920 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