WGET忽略--content-处置? [英] WGET ignoring --content-disposition?

查看:721
本文介绍了WGET忽略--content-处置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行一个命令下载并行3000文件。我使用Cygwin + Windows操作系统。

I am trying to run a command to download 3000 files in parallel. I am using Cygwin + Windows.

通过WGET终端下载一个文件:

Downloading a single file via WGET in terminal :

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奇,以正确的格式(只要 - 内容处置是命令)。

我遍历这个REST API调用来下载整个文件夹(3000文件)。这工作不错,但速度很慢。

I iterate over this REST API call to download the entire folder (3000 files). This works OK, but is quite slow.

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的程序,同步发展。

Now I am trying to run the program in Cygwin, in parallel.

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

它运行,但文件名和格式丢失(而不是的index.html,例如,我们可能会 4 @类型=文件作为文件名)。

It runs, but the file-name and format is lost (instead of "index.html", for example, we may get "4@type=file" as the file-name).

有没有办法对我来说,解决这个问题?

Is there a way for me to fix this?

推荐答案

目前还不清楚,你想他们的名字命名的。让我们假设你希望他们命名为:指数[1-3000]的.html

It is unclear what you would like them named. Let us assume you want them named: 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-处置而造成的。实验和的wget 按CygWin的使用可能会比年长的wget 由FOR循环使用。要检查运行:

My guess is that it is caused by --content-disposition being experimental, and the wget used by CygWin may be older than the wget used by the FOR loop. To check that run:

wget --version

在Cygwin中和Cygwin(即在这里您将运行FOR循环)。

in CygWin and outside CygWin (ie. where you would run the FOR loop).

这篇关于WGET忽略--content-处置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆