Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Partial download with wget [closed]

I see curl supports partial downloads:

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

Example:

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

However, can wget accomplish something similar?

like image 687
Zombo Avatar asked Jan 24 '14 02:01

Zombo


1 Answers

Unfortunately wget doesn't have this feature(at least with my GNU Wget 1.10.2 (Red Hat modified)), which is very annoying. You can send the Range header with HTTP request, but doesn't work.

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

It returns

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

It seemed that the wget had the proper response, but strangely, it didn't finish it. For example with verbose mode output:

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.
like image 131
Sabuj Hassan Avatar answered Nov 04 '22 08:11

Sabuj Hassan