【问题标题】:Partial download with wget [closed]使用 wget 进行部分下载 [关闭]
【发布时间】:2014-02-14 21:39:22
【问题描述】:

我看到curl支持部分下载:

-r, --range RANGE   Retrieve only the bytes within a range

例子:

curl -r 0-99 http://example.com/bar.mp4

但是,wget 可以完成类似的事情吗?

【问题讨论】:

    标签: curl command-line wget


    【解决方案1】:

    很遗憾wget 没有这个功能(至少我的GNU Wget 1.10.2 (Red Hat modified) 没有),这很烦人。您可以使用 HTTP 请求发送 Range 标头,但不起作用。

    wget "http://www.example.com"  -c --header="Range: bytes=0-99"
    

    返回

    HTTP request sent, awaiting response... 206 Partial Content
    Giving up.
    

    似乎 wget 有正确的响应,但奇怪的是,它没有完成它。例如详细模式输出:

    HTTP request sent, awaiting response... 
      HTTP/1.0 206 Partial Content
      Accept-Ranges: bytes
      Cache-Control: max-age=604800
      Content-Range: bytes 0-99/1270
      Content-Type: text/html
      Date: Fri, 24 Jan 2014 08:35:18 GMT
      Etag: "359670651"
      Expires: Fri, 31 Jan 2014 08:35:18 GMT
      Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
      Server: ECS (ftw/FBA9)
      X-Cache: HIT
      Content-Length: 100
      Connection: keep-alive
    Giving up.
    

    【讨论】:

    • 我看到了完全相同的结果。正常吗?部分内容是否下载成功?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多