I have a firend who gave me a very specific problem, he has a list of plain text words (for purpose of writing i'll just call this list he has list.txt and i'll populate it will basic words) and he wants to pull an audio only file of each word on this list from youtube. So i decided youtube-dl would be the fastest tool.
Since the list.txt is a plain words list and not a list youtube links it makes it harder to download in bulk. After reading all the documents I think the simplest way is to use the search feature built into youtube-dl.
List.txt
- blue
- river
- red
- (ETC...)
So basically something that does this. but since there is a lot more than just 3 items this isn't really practical.
youtube-dl.exe -f bestaudio ytsearch:blue
youtube-dl.exe -f bestaudio ytsearch:river
youtube-dl.exe -f bestaudio ytsearch:red
I've been looking all day for something similar to this bit of code below that can take a .txt file and search youtube and download 1 audio/video per item on this list.
youtube-dl.exe -f bestaudio ytsearch:list.txt
I work more with network stuff rather than coding so im kinda out of my depth here and only really have basic coding skills so any help is much appreciated
Solution that ended up working for me
also because i need file conversion i used ffmpeg which has built in support for youtube-dl
youtube-dl -c --title --batch-file test.txt --default-search "ytsearch" -x
-c Force resume of partially downloaded files.
--title not really sure doesnt seem to make a diffrence anyhow
- -x as alastairtree pointed out its a better way to get audio
Ps. Thanks to all who tried to help me and my friend solve our problem