about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/assets/javascripts/services.js9
-rw-r--r--src/config.json7
2 files changed, 15 insertions, 1 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index ac841427..b9ee64e5 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -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)
@@ -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
 		}
diff --git a/src/config.json b/src/config.json
index fbe2fe1b..76e4b022 100644
--- a/src/config.json
+++ b/src/config.json
@@ -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": [