Curl 找不到中央目录签名的结尾

Curl 找不到中央目录签名的结尾,curl,zip,unzip,Curl,Zip,Unzip,我使用LinuxZIP命令创建了zip文件,并将其上传到我的google驱动器中。当我尝试使用curl和unzip命令(使用bash文件)下载并解压缩压缩文件时,它给出了以下错误 Archive: pretrained_models.zip End-of-central-directory signature not found. Either this file is not a zipfile, or it constitutes one disk of a multi-part

我使用LinuxZIP命令创建了zip文件,并将其上传到我的google驱动器中。当我尝试使用curl和unzip命令(使用bash文件)下载并解压缩压缩文件时,它给出了以下错误

Archive:  pretrained_models.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of pretrained_models.zip or
        pretrained_models.zip.zip, and cannot find pretrained_models.zip.ZIP, period.
有人能提出解决此问题的方法吗

如果有人想重现错误,我将共享
.sh
文件

#!/bin/bash
pretrained='https://drive.google.com/uc?export=download&id=0B8ZGlkqDw7hFSm1MQ2FDVTZCTjA' 
# download pretrained models.
curl -o pretrained_models.zip $pretrained
unzip pretrained_models.zip
rm pretrained_models.zip
该文件是公开共享的。要进行健全性检查,您可以从下载


注意:我在SO的其他社区看到过相关帖子,其中一些帖子建议使用不同的文件扩展名,但我想坚持使用zip文件。

当下载Google Drive上的共享文件时,有必要根据文件大小更改下载方法。发现改变方法时文件大小的边界约为40MB

修改的脚本: 1.文件大小<40MB 2.文件大小>40MB 当它试图下载超过40MB的文件时,谷歌表示要从以下URL下载

<a id="uc-download-link" class="goog-inline-block jfk-button jfk-button-action" href="/uc?export=download&amp;confirm=####&amp;id=### file ID ###">download</a>

@瓦西·艾哈迈德,很抱歉给您带来不便。我可以问你以下问题吗?1.0B8ZGlkqDw7hFSm1MQ2FDVTZCTjA的文件ID是zip文件吗?2.文件是否共享?3.当您运行
curl-L'https://drive.google.com/uc?export=download&id=0B8ZGlkqDw7hFSm1MQ2FDVTZCTjA“
,是否存在一些错误?你能看到二进制吗?在我的谷歌硬盘中,我确认修改后的脚本工作正常。@Wasi Ahmad,请再次确认文件ID。是的,文件是公共的。我已经用链接更新了我的帖子。使用-L运行curl命令时会出现相同的错误。@Wasi Ahmad我可以尝试下载您的文件ID吗?是的,当然可以。id为0B8ZGLKDW7HFSM1MQ2FDVTZCTJA
<a id="uc-download-link" class="goog-inline-block jfk-button jfk-button-action" href="/uc?export=download&amp;confirm=####&amp;id=### file ID ###">download</a>
#!/bin/bash
filename="pretrained_models.zip"
fileid="0B8ZGlkqDw7hFSm1MQ2FDVTZCTjA"
query=`curl -c ./cookie.txt -s -L "https://drive.google.com/uc?export=download&id=${fileid}" | pup 'a#uc-download-link attr{href}' | sed -e 's/amp;//g'`
curl -b ./cookie.txt -L -o ${filename} "https://drive.google.com${query}"