about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/assets/javascripts/services.js7
-rw-r--r--src/config.json46
2 files changed, 33 insertions, 20 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index 6dd73561..cfaba48e 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -496,6 +496,13 @@ function redirect(url, type, initiator, forceRedirection) {
 			}
 			return `${randomInstance}${url.pathname}${url.search}`
 		}
+		case "invidiousMusic": {
+			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}`
+		}
 		case "libremdb": {
 			if (url.pathname.startsWith("/Name")) {
 				for (const [key, value] of url.searchParams.entries()) {
diff --git a/src/config.json b/src/config.json
index 72cb6b83..6cc38774 100644
--- a/src/config.json
+++ b/src/config.json
@@ -18,26 +18,6 @@
 		}
 	},
 	"services": {
-		"youtubeMusic": {
-			"frontends": {
-				"hyperpipe": {
-					"name": "Hyperpipe",
-					"instanceList": true,
-					"url": "https://codeberg.org/Hyperpipe/Hyperpipe"
-				}
-			},
-			"targets": [
-				"^https?:\\/{2}music\\.youtube\\.com\\/"
-			],
-			"name": "YT Music",
-			"options": {
-				"enabled": false,
-				"frontend": "hyperpipe",
-				"unsupportedUrls": "bypass"
-			},
-			"imageType": "png",
-			"url": "https://music.youtube.com"
-		},
 		"youtube": {
 			"frontends": {
 				"invidious": {
@@ -141,6 +121,32 @@
 			"embeddable": true,
 			"url": "https://youtube.com"
 		},
+		"youtubeMusic": {
+			"frontends": {
+				"hyperpipe": {
+					"name": "Hyperpipe",
+					"instanceList": true,
+					"url": "https://codeberg.org/Hyperpipe/Hyperpipe"
+				},
+				"invidiousMusic": {
+					"name": "Invidious",
+					"embeddable": true,
+					"instanceList": true,
+					"url": "https://invidious.io/"
+				}
+			},
+			"targets": [
+				"^https?:\\/{2}music\\.youtube\\.com\\/"
+			],
+			"name": "YT Music",
+			"options": {
+				"enabled": false,
+				"frontend": "hyperpipe",
+				"unsupportedUrls": "bypass"
+			},
+			"imageType": "png",
+			"url": "https://music.youtube.com"
+		},
 		"twitter": {
 			"frontends": {
 				"nitter": {