You are not logged in.
This works;
@echo off
set url=https://www.youtube.com/watch?v=GsSxEdL56sU
youtube-dl.exe --get-filename %url%
However, when I try to feed the output of that command to a For token, YouTube-DL itself fails;
@echo off
set url=https://www.youtube.com/watch?v=GsSxEdL56sU
for /f %%F in ('youtube-dl.exe --get-filename %url%') do set Name=%%F
echo %Name%
Am I doing something wrong?
Offline
The = is treated as a separator in for loops, so you need to wrap the URL in quotes.
@echo off
set url=https://www.youtube.com/watch?v=GsSxEdL56sU
for /f %%F in ('youtube-dl.exe --get-filename "%url%"') do set Name=%%F
echo %Name%
Offline
The = is treated as a separator in for loops, so you need to wrap the URL in quotes.
@echo off set url=https://www.youtube.com/watch?v=GsSxEdL56sU for /f %%F in ('youtube-dl.exe --get-filename "%url%"') do set Name=%%F echo %Name%
Thank you. I also had to add "delims=" or it only returned the first word of the title.
Offline