问题描述
我试图从一个脚本从谷歌驱动器下载一个文件,我有一个麻烦这样做。我尝试下载的文件是
基本上你必须创建一个公共目录并通过相关引用访问你的文件,例如
wget
警告:此功能已弃用。
或者,您也可以使用以下脚本:
I'm trying to download a file from google drive in a script, and I'm having a little trouble doing so. The files I'm trying to download are here.
I've looked online extensively and I finally managed to get one of them to download. I got the UIDs of the files and the smaller one (1.6MB) downloads fine, however the larger file (3.7GB) always redirects to a page which asks me whether I want to proceed with the download without a virus scan. Could someone help me get past that screen?
Here's how I got the first file working -
curl -L "https://docs.google.com/uc?export=download&id=0Bz-w5tutuZIYeDU0VDRFWG9IVUE" > phlat-1.0.tar.gz
When I run the same on the other file,
curl -L "https://docs.google.com/uc?export=download&id=0Bz-w5tutuZIYY3h5YlMzTjhnbGM" > index4phlat.tar.gz
I get the the following output -
I notice on the third-to-last line in the link, there a &confirm=JwkK
which is a random 4 character string but suggests there's a way to add a confirmation to my URL. One of the links I visited suggested &confirm=no_antivirus
but that's not working.
I hope someone here can help with this!
Thanks in advance.
Have a look at this: Direct download from Google Drive using Google Drive API
Basically you have to create a public directory and access your files by relative reference with something like
wget https://googledrive.com/host/LARGEPUBLICFOLDERID/index4phlat.tar.gz
WARNING: This functionality is deprecated. See warning below in comments.
Alternatively, you can use this script: https://github.com/Nanolx/patchimage/blob/master/tools/gdown.pl
这篇关于wget / curl大文件从谷歌驱动器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!