Downloading a file with wget using multiple connections [closed]
Asked Answered
P

3

45

How to download a file with wget using multiple connection in which each connection downloads a part of the file?

Poliard answered 1/3, 2014 at 12:50 Comment(2)
See also #3431310Gigantes
Does this answer your question? Multiple simultaneous downloads using Wget?Beheld
C
50

use aria2

 aria2c -x 16 [url] #where 16 is the number of connections

OR

Just repeat the wget -r -np -N [url] for as many threads as you need. This isn’t pretty and there are surely better ways to do this, but if you want something quick and dirty it should do the trick.

Culm answered 1/3, 2014 at 12:58 Comment(6)
The solution you gave for wget downloads a single file multiple times resulting in multiple copies, but I want to download a single file using multiple connection, each of which downloads its part of file.Poliard
wget solution doesn't download one file in multiple threads: The options used -r is recursive, -np (--no-parent) — don't ascend to the parent directory, -N (--timestamping) — don't re-retrieve files unless newer than local. But wget would definitely work if you're downloading a mirror of a site.Aglimmer
@Trix -x, --max-connection-per-server=NUM The maximum number of connections to one server for each download. Possible Values: 1-16 Default: 1 Tags: #basic, #http, #ftpPantheas
perhaps the flag -nc was intended, not -npPattipattie
The link in the answer is 404Payment
On Ubuntu you can install aria2 with sudo apt-get install aria2Legpull
G
34
sudo apt-get install axel
axel -n 5 url

Would do the work!

Axel is a lightweight program that helps with the downloads and supports multiple connections.

Want to resume download after a disconnection? No problem, just repeat the command and axel will take care of it.

Gigahertz answered 10/2, 2016 at 5:19 Comment(2)
Not very useful with long S3 pre-signed URLs due to Can't handle URLs of length over 1024 limitationImpersonalize
I have the same issue with S3 pre-signed URLs. This command is totally useless and it doesn't make sense to have a 1024 character limit on a URL in 2023...Legpull
M
-1

Axel supports visual indicator. axel -a -n [X parts] [URL]

Mangum answered 7/6, 2022 at 15:26 Comment(1)
What is the additional insight you contribute on top of https://mcmap.net/q/367827/-downloading-a-file-with-wget-using-multiple-connections-closed ?Evolve

© 2022 - 2024 — McMap. All rights reserved.