使用wget命令下载Google drive上的文件

此处的文件是指公开的文件,不需要输入密码也不需要登录Google drive即可获取的文件。

1. 下载小文件
wget –no-check-certificate ‘https://docs.google.com/uc?export=download&id=FILEID’ -O FILENAME

替换对应的FILEID即可,FILENAME自己命名。
FILEID是Google drive公开分享的链接中ID后面的,例如:

https://drive.google.com/open?id=ThisIsFileID

如果下载中断了,想要继续下载,可以在wget后面添加 -c 参数

2. 下载大文件
因为Google drive的大文件,无法通过安全查杀

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
1
同样替换其中的FILEID和FILENAME即可。注意FILEID有两处。

参考:https://gist.github.com/iamtekeste/3cdfd0366ebfd2c0d805
————————————————
版权声明:本文为CSDN博主「Jonah_Mao」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/Mao_Jonah/article/details/88372086

17人评论了“使用wget命令下载Google drive上的文件”

  1. Great goods from you, man. I’ve be mindful your stuff previous to and you’re simply
    too excellent. I actually like what you have received right here, really like what
    you’re saying and the best way by which you say it. You’re making it enjoyable
    and you still care for to stay it smart. I cant wait to read much more from you.
    This is actually a tremendous site.

  2. hello there and thank you for your information – I’ve definitely picked up anything new from right here.
    I did however expertise several technical points using this site, as I experienced to reload the site many times previous to I could get
    it to load properly. I had been wondering if your hosting is OK?
    Not that I’m complaining, but sluggish loading instances times will often affect your placement in google and could damage your high-quality score if advertising and marketing with Adwords.
    Anyway I am adding this RSS to my email and could look out for much
    more of your respective interesting content.
    Make sure you update this again soon.

  3. “Right here is the right website for everyone who really wants to find out about this topic. You know a whole lot its almost hard to argue with you (not that I actually would want toOHaHa). You certainly put a fresh spin on a subject that’s been written about for many years. Great stuff, just excellent!”

发表评论

邮箱地址不会被公开。 必填项已用*标注