Skip to content

extractYoutubeVideoId ​

Import from: @xbbg/xnews

extractYoutubeVideoId(video): string

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

Extracts the 11-character video ID from a bare ID, a watch/shorts/embed/ live URL, or a youtu.be link. Returns undefined for anything else.

Parameters ​

video ​

string

Returns ​

string

Last updated:

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