fetchYoutubeTranscript
Import from: @xbbg/xnews
fetchYoutubeTranscript(
video,options?):Promise<YoutubeTranscript>
Defined in: src/sources/youtubetranscript.ts (declaration: sources/youtubetranscript.d.ts:48)
Fetches a video's transcript through its advertised caption tracks: free and keyless. Accepts a video ID or any YouTube video URL, for example the url of an item returned by fetchYoutubeSubscriptions. Tracks come from the InnerTube player API first (its caption URLs stay readable server-side) with the watch-page player data as fallback. Throws when the video advertises no caption tracks or the caption payload is gated.
Parameters
video
string
options?
Returns
Promise<YoutubeTranscript>
