MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / getVideoId

Function getVideoId

apps/web/ui/Message/Link/Video/utilities.ts:16–25  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

14}
15
16export function getVideoId(url: string) {
17 if (isYoutubeShortUrl(url)) {
18 return url.split('/').pop();
19 }
20 if (isYoutubeWatchUrl(url)) {
21 const params = new URLSearchParams(url.split('?')[1]);
22 return params.get('v');
23 }
24 return null;
25}

Callers 1

VideoFunction · 0.90

Calls 3

isYoutubeShortUrlFunction · 0.90
isYoutubeWatchUrlFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected