feat(embeds): add support to youtube shorts

This commit is contained in:
Tom (plebeius.eth)
2025-02-27 12:26:38 +01:00
parent 0e0e7c22cb
commit 306e7b081f
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -74,6 +74,8 @@ const YoutubeEmbed = ({ parsedUrl }: EmbedComponentProps) => {
if (!videoId) {
if (parsedUrl.host.includes('youtu.be')) {
videoId = parsedUrl.pathname.substring(1);
} else if (parsedUrl.pathname.includes('/shorts/')) {
videoId = parsedUrl.pathname.split('/shorts/')[1];
} else if (isInvidious) {
if (parsedUrl.pathname.startsWith('/watch')) {
videoId = parsedUrl.searchParams.get('v');