about summary refs log tree commit diff stats
path: root/src/assets
diff options
context:
space:
mode:
Diffstat (limited to 'src/assets')
-rw-r--r--src/assets/javascripts/services.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index 573318ee..e096ef99 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}`
 		}