yt-dlp --skip-download --write-sub --write-auto-sub --sub-lang en --sub-format json3 -o transcript <video>
cue eval json: transcript.en.json3 -e 'strings.Join(list.FlattenN([for _,evt in events if evt.segs != _|_ for _,s in evt.segs { s.utf8} ],2),"")' --out text > transcript.en.txt
Bonus with yt-dlp is that it supports a lot more than YT