From 412fe200706fc9f8fe783bfa53293dc131f472b2 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Tue, 7 Feb 2023 20:46:39 +0300 Subject: Added PokeTube https://github.com/libredirect/libredirect/issues/623 --- src/assets/javascripts/services.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/assets/javascripts') 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'], -- cgit 1.4.1