Skip to content

Commit

Permalink
Added Invidious for YT Music #830
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed Oct 18, 2023
1 parent 4e379b0 commit 9317c75
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 20 deletions.
7 changes: 7 additions & 0 deletions src/assets/javascripts/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
46 changes: 26 additions & 20 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit 9317c75

Please sign in to comment.