Skip to content

pickYoutubeCaptionTrack ​

Import from: @xbbg/xnews

pickYoutubeCaptionTrack(tracks, languages?): YoutubeCaptionTrack

Defined in: src/sources/youtubetranscript.ts (declaration: sources/youtubetranscript.d.ts:56)

Picks the best caption track for a language preference list: exact code match first, then same base language (e.g. "en" matches "en-US"), with manual tracks preferred over auto-generated ones, then any track at all.

Parameters ​

tracks ​

readonly YoutubeCaptionTrack[]

languages? ​

readonly string[]

Returns ​

YoutubeCaptionTrack

Last updated:

xbbg is independent open-source software and is not affiliated with, endorsed by, sponsored by, or approved by Bloomberg Finance L.P.