diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 6dd7356..cfaba48 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 72cb6b8..6cc3877 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": {