From d2cc8a146b01eb02411164b83ab02c665717bd96 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Thu, 7 Sep 2023 12:20:08 +0300 Subject: [PATCH] Temporary fixed invidious redirecting bug https://github.com/libredirect/browser_extension/issues/763 --- src/assets/javascripts/services.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 573318e..e096ef9 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -155,7 +155,7 @@ function redirect(url, type, initiator, forceRedirection) { return url.href.replace(/^https?:\/{2}/, "yattee://") } case "freetube": { - return 'freetube://' + url.href + return 'freetube://' + url.href } case "poketube": { if (url.pathname.startsWith('/channel')) { @@ -561,6 +561,13 @@ function redirect(url, type, initiator, forceRedirection) { } return `${randomInstance}${url.pathname}${url.search}` } + case "invidious": { + if (url.hostname == "youtu.be" || url.hostname.endsWith("youtube.com") && url.pathname.startsWith("/live")) { + const watch = url.pathname.substring(url.pathname.lastIndexOf('/') + 1) + return `${randomInstance}/watch?v=${watch}` + } + return `${randomInstance}${url.pathname}${url.search}` + } default: { return `${randomInstance}${url.pathname}${url.search}` }