From ee7dfbf848be1b39a8e6bf5201e201015dea3c20 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Fri, 13 Oct 2023 14:11:18 +0200 Subject: [PATCH] :bug: (videoBubble) Fix youtube parsing for IDs containing a "-" --- packages/lib/parseVideoUrl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/lib/parseVideoUrl.ts b/packages/lib/parseVideoUrl.ts index 651538347..862279f6a 100644 --- a/packages/lib/parseVideoUrl.ts +++ b/packages/lib/parseVideoUrl.ts @@ -1,7 +1,8 @@ import { VideoBubbleContentType } from '@typebot.io/schemas/features/blocks/bubbles/video/enums' const vimeoRegex = /vimeo\.com\/(\d+)/ -const youtubeRegex = /youtube\.com\/(watch\?v=|shorts\/)(\w+)|youtu\.be\/(\w+)/ +const youtubeRegex = + /youtube\.com\/(watch\?v=|shorts\/)([\w-]+)|youtu\.be\/([\w-]+)/ export const parseVideoUrl = ( url: string