I have worked first with the file downloaded to make sure I got the result right. Those drafts are not here.
After that we have four solutions:
- A simple one that fetches the entire payload in one request.
- An streamed one, same idea, but processing by chunks.
- A parallel approach that speeds up the download using HTTP range requests.
- A variant of the previous one that parallelizes the computation as well.