I recently discovered youtube-dl and I wanted to make a batch file within the folder of the youtube-dl executable that asks for a url and uses that url in the
youtube-dl --extract-audio --audio-format mp3 -i -o songs\%(title)s.%(ext)s <video URL>
command, which saves the video as an mp3 file in the \songs\ folder in the same filepath as the executable. The command works fine if I copy-paste it into a command prompt and replace <video url>
with the actual url, but when I try to put this in a batch file (e.g. with set var1=""
) it uses the variable's name in the command (youtube-dl --extract-audio --audio-format mp3 -i -o songs\%(title)s.%(ext)s var1
).
I've found this, and it seems to be what I'm looking for, but it didn't make any sense.