const { Innertube } = require('youtubei.js');
async function test() {
  try {
    const yt = await Innertube.create();
    const info = await yt.getInfo('dQw4w9WgXcQ');
    const transcriptData = await info.getTranscript();
    console.log(transcriptData.transcript.content.body.initial_segments.map(s => s.snippet.text).join(' ').substring(0, 500));
  } catch (err) {
    console.error(err);
  }
}
test();
