I would like to know what's wrong with the syntax of the second command below. It doesn't give expected result.
This line results with expected file name that consist of video title from yt and fixed file extension.
yt-dlp --print filename -o %(title)s.mkv https://www.youtube.com/watch?v=Diw4iqKSV8I
gd3kr⧸BlenderGPT - Gource visualisation.mkv
But when I try to set initial commands' output to a variable with this line, the output title is trimmed and there's no extension (missing: " - Gource visualisation.mkv").
for /F %O in ('"yt-dlp --print filename -o %(title)s.mkv https://www.youtube.com/watch?v=Diw4iqKSV8I"') do set output=%O
set output=gd3kr⧸BlenderGPT
How to modify this line to get full expected string?