diff --git a/components/member/ProfileVideo.vue b/components/member/ProfileVideo.vue
index 15cc153..9a52008 100644
--- a/components/member/ProfileVideo.vue
+++ b/components/member/ProfileVideo.vue
@@ -1,7 +1,14 @@
@@ -11,7 +18,7 @@ defineProps<{
Profile Video
-
+
diff --git a/utils/index.ts b/utils/index.ts
index 9708930..b1c537b 100644
--- a/utils/index.ts
+++ b/utils/index.ts
@@ -423,3 +423,20 @@ export function youtubeViewsFormat(
}
return formattedViews
}
+
+export function getVideoId(youtubeUrl: string): string | null {
+ try {
+ const url = new URL(youtubeUrl)
+ const videoId = url.searchParams.get('v') ?? url.pathname.split('/').pop()
+
+ if (videoId) {
+ return videoId
+ }
+
+ return youtubeUrl
+ }
+ catch (error) {
+ console.error('Invalid URL:', error)
+ return youtubeUrl
+ }
+}