Skip to content

Commit a20082d

Browse files
committed
Added Freetube to YouTube Music #940
1 parent 9e6862a commit a20082d

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/assets/javascripts/services.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,13 @@ function rewrite(url, frontend, randomInstance) {
396396
return url.href
397397
return `${randomInstance}${url.pathname}${url.search}`
398398
}
399+
case "freetubeMusic": {
400+
if (url.hostname == "youtu.be" || url.hostname.endsWith("youtube.com") && url.pathname.startsWith("/live")) {
401+
const watch = url.pathname.substring(url.pathname.lastIndexOf('/') + 1)
402+
return `freetube://youtube.com/watch?v=${watch}`
403+
}
404+
return 'freetube://' + url.href
405+
}
399406
case "invidiousMusic": {
400407
if (url.hostname == "youtu.be" || url.hostname.endsWith("youtube.com") && url.pathname.startsWith("/live")) {
401408
const watch = url.pathname.substring(url.pathname.lastIndexOf('/') + 1)
@@ -683,7 +690,7 @@ async function reverse(url) {
683690
case "tekstowo":
684691
return `${config.services[service].url}/${url.search.slice(1)}`
685692
case "goodreads":
686-
return `https://goodreads.com${url.pathname}${url.search}`
693+
return `https://goodreads.com${url.pathname}${url.search}`
687694
default:
688695
return
689696
}

src/config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@
159159
"embeddable": true,
160160
"instanceList": true,
161161
"url": "https://invidious.io/"
162+
},
163+
"freetubeMusic": {
164+
"name": "FreeTube",
165+
"embeddable": false,
166+
"desktopApp": true,
167+
"instanceList": false,
168+
"url": "https://github.com/FreeTubeApp/FreeTube"
162169
}
163170
},
164171
"targets": [

0 commit comments

Comments
 (0)