Issue
I am trying to resume download of a file using curl.
I am using the below command:
curl -L -o /home/guest/1.mp4 -C - "url_to_download"
** Resuming transfer from byte position 4967989
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 207 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
I gives the above error. How to get the proper message of finished downloading. Because based on this i have to start another command if the download is completed.
$ curl --version
curl 7.53.1 (x86_64-pc-linux-gnu) libcurl/7.53.1 OpenSSL/1.0.2k zlib/1.2.11 libpsl/0.17.0 (+libicu/58.2) libssh2/1.8.0
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile GSS-API Kerberos SPNEGO NTLM NTLM_WB SSL libz TLS-SRP UnixSockets HTTPS-proxy PSL
Solution
While I was running:
curl -O -C - "my_url"
I had got a similar error:
curl: (33) HTTP server doesn't seem to support byte ranges. Cannot resume.
[2]- Exit 33 nohup curl -O -C - "my_url"
Solution by trial and error:
I added the -L tag to this and then the download resumed from where the last byte it stopped at.
curl -L -O -C - "my_url"
** Resuming transfer from byte position 8637478709
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
11 1598M 11 176M 0 0 1138k 0 0:23:57 0:02:38 0:21:19 1131k
Note:
- "-L" : follows redirects
- "-O" : write output to a local file named like the remote file we get.
- "-C - " : continues previously unfinished download
Answered By - Bantu Manjunath Answer Checked By - Marie Seifert (WPSolving Admin)