是否可以使wget的进度栏适应多个文件? [英] Is it possible to adapt wget's progress bar to several files?

查看:72
本文介绍了是否可以使wget的进度栏适应多个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过或多或少的操作,我正在下载某些目录的所有".htm"文件:

I'm downloading all the ".htm" files of some directories by doing more or less:

wget http://some/url/-r --accept ="*.htm" -nv --show-progress

我关闭了wget的打印但保留了进度条,这在我的情况下很有用( -nv --show-progress )

In which i turned off wget's printing but keeped the progress bar which is useful in my case (-nv --show-progress)

这很好用,但是会输出一个每个下载文件的进度条.有没有可能出现一个单个进度条,该进度条会考虑所有文件大小的总和?

This works great but outputs a progress bar for every downloaded file. Is it a possible to have a single progress bar that would take into the sum of all the sizes of the files?

我查看了 progress = TYPE 选项,但这似乎只是设置进度条的样式,而不是设置下载数据的总量

I looked at the the progress=TYPE option but this only seems to setup the style of the progress bar and not the total amount of downloaded data

推荐答案

否,当前在Wget中无法使用单个聚合条.

No, currently there is no way in Wget to have a single aggregate bar.

但是,您可以尝试使用 Wget 2.0 的Alpha版本.它并不是您要找的东西,但是非常接近.它已在Debian中作为Wget2打包,可在Arch Linux的AUR上获得.我不确定其他发行版.

However, you can try the alpha version of Wget 2.0. It's not exactly what you're looking for, but comes very close. It has been packages as Wget2 in Debian and is available on Arch Linux's AUR. I'm not sure about other distros.

wget2 默认情况下支持并行下载和HTTP/2,并且在进度条下方的一行显示了一些汇总统计信息.例如:

wget2 supports parallel downloads and HTTP/2 by default and a line under the progress bars showing some aggregate stats. For example:

$ wget2 --progress=bar "example.com/?"{0,1,2,3,4,5,6,7,8}
index.html?8         100% [========================================================================================================================>]     606    32,88KB/s
index.html?5         100% [========================================================================================================================>]     606    18,49KB/s
index.html?6         100% [========================================================================================================================>]     606    31,15KB/s
index.html?7         100% [========================================================================================================================>]     606    32,88KB/s
index.html?4         100% [========================================================================================================================>]     606    34,81KB/s
                          [Files: 9  Bytes: 5,33K [11,78KB/s] Redirects: 0  Todo: 0  Errors: 0                                       ]

您看到5个进度条,因为使用了5个线程并行下载9个文件.最后一个栏表示汇总统计信息.

You see 5 progress bars because 5 threads were used to download the 9 files in parallel. The last bar indicates aggregate stats.

您可以从git或使用以下可用的v1.99 tarball轻松构建Wget2: https://alpha.gnu.org/gnu/wget/wget2-1.99.0.tar.gz

You can easily build Wget2 from git or using the v1.99 tarball available here: https://alpha.gnu.org/gnu/wget/wget2-1.99.0.tar.gz

免责声明:我同时维护GNU Wget和Wget2.

DISCLAIMER: I maintain both GNU Wget and Wget2.

这篇关于是否可以使wget的进度栏适应多个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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