YouTube.js icon indicating copy to clipboard operation
YouTube.js copied to clipboard

Cannot retrieve transcript: "engagement-panel-searchable-transcript" missing from some videos

Open hatemmezlini opened this issue 11 months ago • 3 comments

Steps to reproduce

const { Innertube } = require('youtubei.js');

async function main() {
    const youtube = await Innertube.create({
            lang: 'en',
            location: 'US',
            retrieve_player: true,
        });
    const fetchTranscript = async () => {
        const videoId = "1nQXYsm4pr8";
        const info = await youtube.getInfo(videoId);
        console.log(info.page[1].engagement_panels);  // Missing engagement-panel-searchable-transcript panel but present on YT
        const transcript = await info.getTranscript();  // <--  throw new InnertubeError('Transcript panel not found. Video likely has no transcript.');
        return transcript;
     }
     const transcript = await fetchTranscript();
     console.log(transcript);
 }
 main();

Failure Logs

Error in main function: InnertubeError: Transcript panel not found. Video likely has no transcript.
    at ...
  date: 2025-01-08T17:28:22.904Z,
  version: '12.2.0'
}

Expected behavior

TranscriptInfo {
  transcript: Transcript {
    type: 'Transcript',
    content: TranscriptSearchPanel {
      type: 'TranscriptSearchPanel',
      header: null,
      body: [TranscriptSegmentList],
      footer: [TranscriptFooter],
      target_id: 'engagement-panel-searchable-transcript-search-panel'
    }
  }
}

Current behavior

engagement-panel-searchable-transcript is missing when looking at panels at info.page

Version

Default

Anything else?

It works with this videoID: DXR_MzGW768 because it's in English but not the other one (Romanian). Both videos have only automatically generated cc

Checklist

  • [X] I am running the latest version.
  • [X] I checked the documentation and found no answer.
  • [X] I have searched the existing issues and made sure this is not a duplicate.
  • [X] I have provided sufficient information.

hatemmezlini avatar Jan 08 '25 17:01 hatemmezlini

Any news ?

hatemmezlini avatar Jan 30 '25 13:01 hatemmezlini

I haven't checked this yet. It could be that the engagement panel is somewhere else on the page, or YouTube is simply not returning it due to a bug on their side, or possibly a parameter we're not providing.

LuanRT avatar Jan 31 '25 03:01 LuanRT

Hi ! Just wanted to kindly follow up on this issue. I know maintainers are often busy. I just wanted to check if you’ve had a chance to take a look at it.

And thanks for the good work!

hatemmezlini avatar Sep 13 '25 15:09 hatemmezlini