我正在尝试运行一个命令来并行下载3000个文件。我正在使用Cygwin + Windows。
在终端通过WGET下载单个文件:
wget --no-check-certificate --content-disposition --load-cookies cookies.txt \ -p https://username:password@website.webpage.com/folder/document/download/1?type=file允许我以正确的格式单独下载ID为1的文件(只要命令中包含--content-disposition )。
我迭代了这个REST API调用来下载整个文件夹(3000个文件)。这可以正常工作,但速度很慢。
FOR /L %i in (0,1,3000) do wget --no-check-certificate --content-disposition --load-cookies cookies.txt \ -p https://username:password@website.webpage.com/folder/document/download/%i?type=file现在,我正在尝试在Cygwin中并行运行程序。
seq 3000 | parallel -j 200 wget --no-check-certificate --content-disposition --load-cookies cookies.txt -p https://username:password@website.webpage.com/folder/document/download/{}?type=file它会运行,但文件名和格式会丢失(例如,我们可能会获得"4@type=file"作为文件名,而不是"index.html" )。
有没有办法让我解决这个问题?
发布于 2015-04-30 15:23:32
现在还不清楚你想给他们起什么名字。假设您想将它们命名为: index.1-3000.html
seq 3000 | parallel -j 200 wget -O index.{}.html --no-check-certificate --content-disposition --load-cookies cookies.txt -p https://username:password@website.webpage.com/folder/document/download/{}?type=file我的猜测是--content-disposition是实验性的,CygWin使用的wget可能比FOR循环使用的wget旧。要检查该运行,请执行以下操作:
wget --version在CygWin中和在CygWin之外(即在其中运行FOR循环)。
https://stackoverflow.com/questions/29942855
复制相似问题