From bae1cd3ce148003d6e9c67912410fc624a5723a7 Mon Sep 17 00:00:00 2001 From: FireMasterK <20838718+FireMasterK@users.noreply.github.com> Date: Tue, 20 Jul 2021 02:55:43 +0530 Subject: [PATCH] Add support for youtu.be 11 character redirects. --- src/components/VideoRedirect.vue | 17 +++++++++++++++++ src/router/router.js | 6 ++++++ 2 files changed, 23 insertions(+) create mode 100644 src/components/VideoRedirect.vue diff --git a/src/components/VideoRedirect.vue b/src/components/VideoRedirect.vue new file mode 100644 index 00000000..1394969d --- /dev/null +++ b/src/components/VideoRedirect.vue @@ -0,0 +1,17 @@ + + + + diff --git a/src/router/router.js b/src/router/router.js index 70d7c487..4e80a9f1 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -23,10 +23,12 @@ const routes = [ }, { path: "/:path(v|w|embed|shorts|watch)/:v?", + name: "WatchVideo", component: () => import("../components/WatchVideo.vue"), }, { path: "/:path(channel|user|c)/:channelId/:videos?", + name: "Channel", component: () => import("../components/Channel.vue"), }, { @@ -49,6 +51,10 @@ const routes = [ name: "Import", component: () => import("../components/ImportPage.vue"), }, + { + path: "/:videoId([a-zA-Z0-9_-]{11})", + component: () => import("../components/VideoRedirect.vue"), + }, ]; const router = createRouter({