既然curl支持并行下载,是否可以在配置文件中为每个并发下载添加不同的字节范围头?
For example if I put this in my config.txt config file:
url = "http://www.example.com"
header = "Range: bytes=0-1024"
output = "chunk1"
url = "http://www.example.com"
header = "Range: bytes=1025-2049"
output = "chunk2"
url = "http://www.example.com"
header = "Range: bytes=2050-3074"
output = "chunk3"
and run
curl --parallel --parallel-max 60 --config config.txt
I get 3 chunks downloaded concurrently but always the first byte range 0-1024 instead of each specific byte range per file. Is it impossible or is my config file incorrect?
After running curl with verbose:
> curl -vv --parallel --parallel-max 60 --config config.txt
It shows that curl regroups all ranges and add them to each request therefore only the first one is kept.
> Range: bytes=0-1024
> Range: bytes=1025-2049
> Range: bytes=2050-3074
Thank you for your help.
1条答案
按热度按时间bq3bfh9z1#
我在curl的github页面(https://github.com/curl/curl/issues/5774)上找到了答案,感谢Dan Fandrich @dfandrich:
您可能需要在请求之间使用“next”选项,以使它们使用单独的标头。
在我的例子中,只放next不起作用,但是在配置文件中放**--next**就起作用了!!!
修改后的配置文件现在为:
谢谢你