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
I do apt install python
and wget https://youtube-dl.org/downloads/latest/youtube-dl
and chmod 777 youtube-dl
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)
and
https://www.youtube.com/watch?v=-QwtKBC6iQY (a ricky gervais one)
I've got a file with the two videos
user@basicdroplettest1:~# cat vidfilelist.txt
https://www.youtube.com/watch?v=iXFvkJLqPqo
https://www.youtube.com/watch?v=-QwtKBC6iQY
If I were to do while read in; do ./youtube-dl "$in"; done < vidfilelist
it runs youtube-dl on each line of the file so it does e.g. youtube-dl https://www.youtube.com/watch?v=iXFvkJLqPqo
and then youtube-dl https://www.youtube.com/watch?v=-QwtKBC6iQY
So 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
user@basicdroplettest1:~# cat ./vidfilelist.txt
https://www.youtube.com/watch?v=iXFvkJLqPqo &
https://www.youtube.com/watch?v=-QwtKBC6iQY &
Then do
(this bash while command courtesy of https://stackoverflow.com/questions/13939038/how-do-you-run-a-command-eg-chmod-for-each-line-of-a-file )
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).