0

If you are familiar to Linux, see the following script...

I have a text file with a (list.txt) of Youtube URLs separated by new line... and I use

cat list.txt | youtube-dl -f best 

to download all in the list

This works fine but I want to emulate it on a Windows Batch file..

set /p data=<list.txt
youtube-dl -f best %data%

This works too.. BUT it downloads only the first video on the list.

A Simple solution w.r.t coding would be preferred.

PS:Also it is certain that I'm not looking for solutions using youtube-dl commands

  • 1
    Why don't you just use youtube-dl -a list.txt? – Attie Mar 6 at 14:06
  • @Attie Okay, you may write it as an answer. – user720745 Mar 6 at 14:09
  • What did you mean "not looking for solutions using youtube-dl commands"? – Attie Mar 6 at 15:37
2

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.

-a, --batch-file FILE

File containing URLs to download ('-' for stdin), one URL per line. Lines starting with '#', ';' or ']' are considered as comments and ignored.

In your situation you'd use:

youtube-dl -f best -a list.txt
  • This seems to me as being the best answer for it uses the original tool to do the same and there is a Windows version too. So basically all you need to do is reformat your command according to the answer provided by Attie and just put it in a folder with a batch script and relevant list file. Then all you'll have to do is edit your list file and run your script. Otherwise, though I don't know it properly, I'd suggest looking on PowerShell side. From what I saw it seems they at last included a lot of nice features and commands. – 猫IT Mar 6 at 16:53

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy