From 33fc116bac0e1e3a6e3dab39d21116c078d04567 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Mon, 20 May 2024 14:05:09 +0300 Subject: [PATCH] Fixed timestamps being removed for invidious https://github.com/libredirect/browser_extension/issues/922 --- src/assets/javascripts/services.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index e5a57890..b78cbb99 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -385,11 +385,10 @@ function rewrite(url, frontend, randomInstance) { 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}/watch?v=${watch}${url.search.replace("?", "&")}` } - if (url.hostname.endsWith("youtube.com") && url.pathname.startsWith("/redirect?")) { + if (url.hostname.endsWith("youtube.com") && url.pathname.startsWith("/redirect?")) return url.href - } return `${randomInstance}${url.pathname}${url.search}` } case "invidiousMusic": {