How do you download multiple files/videos, simultaneously, on a basic digitalocean droplet?
Let’s say I create a basic digitalocean droplet/VPS, that runs Ubuntu
I start the console
apt install python (to install a package that is needed by a command i’m going to use)
wget https://youtube-dl.org/downloads/latest/youtube-dl and chmod 777 youtube-dl
(to install a command called youtube-dl that lets me download youtube videos)
There are some files that I want to download e.g. these two video files
https://www.youtube.com/watch?v=iXFvkJLqPqo (the johnny depp one, about 11min long)
https://www.youtube.com/watch?v=-QwtKBC6iQY (a ricky gervais one)
I’ve got a file with links to the videos I want to download
while read in; do ./youtube-dl “$in”; done < vidfilelist
will execute youtube-dl on each line of that file, so it’ll do
The problem is
it downloads the first one, then when that one has completed, it starts downloading the second one.
So it’s not simultaneous
If I put an ampersand at the end of each line, we see it still doesn’t work.
user@basicdroplettest1:~# while read in; do ./youtube-dl “$in”; done < vidfilelist.txt [youtube] iXFvkJLqPqo: Downloading webpage [download] Destination: Top Johnny Depp Comebacks & Reactions to Questioning While Testifying-iXFvkJLqPqo.mp4 [download] 2.5% of 20.67MiB at 50.65KiB/s ETA 06:47
[download] 3.0% of 20.67MiB at 50.90KiB/s ETA 06:43
[download] 3.2% of 20.67MiB at 50.95KiB/s ETA 06:41
[download] 5.5% of 20.67MiB at 51.04KiB/s ETA 06:31
See above, i’m hitting ENTER, but it’s not going into the background and onto the next one…
So that hasn’t worked.
Any ideas how I can get it to download each of the video files in the file, in the background?
(as opposed to downloading one, followed by the other).
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.