Rather than piping it in, you could use functionality provided by
youtube-dl – it has a parameter that allows you to point at a text file containing a list of URLs – one per line.
File containing URLs to download (
-for stdin), one URL per line. Lines starting with
]are considered as comments and ignored.
In your situation you’d use:
youtube-dl -f best -a list.txt
Youtube-dl allow downloading multiple URL at once, so here is a simple solution:
youtube-dl $(cat my-links.txt | xargs)
You can just use
youtube-dl -a yourList.txt where yourList is a file containing URL’s delimited by linebreaks.
if you’re looking for a strictly batch file solution with youtube-dl i suggest you use this
for /f "tokens=*" %i in (videolinks.txt) do (youtube-dl -f best %i)
it goes through the whole file line by line and downloads whatever is on the line (if its a valid link)
if you want to use it in a *.bat file make sure to use double % link
Use a single percent sign (%) to carry out the for command at the command prompt. Use double percent signs (%%) to carry out the for command within a batch file.
First you need a file with URLs or explicit YouTube-IDs. Then you can make a script as follows:
FILE=YT-List.txt #the file with the urls or youtube-ids: 1 item per line while read line do F1=$(echo $line) youtube-dl -f22 -c -R infinite "$F1" & done < $FILE sleep 7 echo "I AM READY"