Skip to content

Commit

Permalink
Added Freetube to YouTube Music #940
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed Jul 9, 2024
1 parent 9e6862a commit a20082d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/assets/javascripts/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,13 @@ function rewrite(url, frontend, randomInstance) {
return url.href
return `${randomInstance}${url.pathname}${url.search}`
}
case "freetubeMusic": {
if (url.hostname == "youtu.be" || url.hostname.endsWith("youtube.com") && url.pathname.startsWith("/live")) {
const watch = url.pathname.substring(url.pathname.lastIndexOf('/') + 1)
return `freetube://youtube.com/watch?v=${watch}`
}
return 'freetube://' + url.href
}
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)
Expand Down Expand Up @@ -683,7 +690,7 @@ async function reverse(url) {
case "tekstowo":
return `${config.services[service].url}/${url.search.slice(1)}`
case "goodreads":
return `https://goodreads.com${url.pathname}${url.search}`
return `https://goodreads.com${url.pathname}${url.search}`
default:
return
}
Expand Down
7 changes: 7 additions & 0 deletions src/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@
"embeddable": true,
"instanceList": true,
"url": "https://invidious.io/"
},
"freetubeMusic": {
"name": "FreeTube",
"embeddable": false,
"desktopApp": true,
"instanceList": false,
"url": "https://github.com/FreeTubeApp/FreeTube"
}
},
"targets": [
Expand Down

0 comments on commit a20082d

Please sign in to comment.