cavaliergopher / grab

A download manager package for Go
BSD 3-Clause "New" or "Revised" License
1.38k stars 151 forks source link

need callback for each internal requests #54

Open hbakhtiyor opened 5 years ago

hbakhtiyor commented 5 years ago

how many internally call http requests? if file exists one head request, is it only this call? or have another? i need to get header ("auth") of the head request and set new one on next request.

any apis to achieve this?

cavaliercoder commented 5 years ago

This is currently not possible but something I should consider. Alternatively, you can perform the head request yourself first and then populate a grab request.

hbakhtiyor commented 5 years ago

how to disable internal additional head requests?

cavaliercoder commented 5 years ago

You can disable grab's HEAD requests by setting Request.NoResume = true. Naturally, this will also prevent grab from being able to resume incomplete downloads.

If you want both features, you will need three request:

If your program is not particularly latency sensitive, this additional HEAD request seem inexpensive to me.