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.js14
-rw-r--r--src/config.json10
2 files changed, 24 insertions, 0 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index cdf40b66..66dff154 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -148,6 +148,19 @@ function redirect(url, type, initiator, forceRedirection) {
 		case "freetube": {
 			return `freetube://https://youtu.be${url.pathname}${url.search}`.replace(/watch\?v=/, "")
 		}
+		case "poketube": {
+			if (url.pathname.startsWith('/channel')) {
+				const reg = /\/channel\/(.*)\/?$/.exec(url.pathname)
+				if (reg) {
+					const id = reg[1]
+					return `${randomInstance}/channel?id=${id}${url.search}`
+				}
+			}
+			if (/\/@[a-z]+\//.exec(url.pathname)) {
+				return randomInstance
+			}
+			return `${randomInstance}${url.pathname}${url.search}`
+		}
 		case "simplyTranslate": {
 			return `${randomInstance}/${url.search}`
 		}
@@ -551,6 +564,7 @@ const defaultInstances = {
 	'piped': ['https://pipedapi-libre.kavin.rocks'],
 	'pipedMaterial': ['https://piped-material.xn--17b.net'],
 	'cloudtube': ['https://tube.cadence.moe'],
+	'poketube': ['https://poketube.fun'],
 	'proxiTok': ['https://proxitok.pabloferreiro.es'],
 	'send': ['https://send.vis.ee'],
 	'nitter': ['https://nitter.net'],
diff --git a/src/config.json b/src/config.json
index fcd2f797..3a3ed06b 100644
--- a/src/config.json
+++ b/src/config.json
@@ -71,6 +71,16 @@
 					"embeddable": false,
 					"instanceList": false,
 					"url": "https://github.com/yattee/yattee"
+				},
+				"poketube": {
+					"excludeTargets": [
+						2,
+						3
+					],
+					"name": "PokeTube",
+					"embeddable": true,
+					"instanceList": true,
+					"url": "https://codeberg.org/Ashley/poketube/"
 				}
 			},
 			"targets": [