about summary refs log tree commit diff stats
path: root/src/assets/javascripts/services.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/assets/javascripts/services.js')
-rw-r--r--src/assets/javascripts/services.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index b319d46b..94d8d980 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -547,10 +547,24 @@ function rewrite(url, frontend, randomInstance) {
       url.searchParams.delete("ie")
       return `${randomInstance}${url.pathname}${url.search}`
     case "shoelace": {
-      const reg = /\/(?:(?:(?:.*)?\/post)|t)\/(.*)(?:\/)?/.exec(url.pathname)
+      const reg = /^\/(?:(?:(?:[^\/])?\/post)|t)\/([^\/])/.exec(url.pathname)
       if (reg) return `${randomInstance}/t/${reg[1]}${url.search}`
       return `${randomInstance}${url.pathname}${url.search}`
     }
+    case "skunkyArt": {
+      if (url.pathname.startsWith('/search')) return `${randomInstance}${url.pathname}${url.search}&scope=all`
+
+      const artReg = /^\/.*?\/art\/(.*)\/?/.exec(url.pathname)
+      if (artReg) return `${randomInstance}/post/art/${artReg[1]}${url.search}`
+
+      const userReg = /^\/([^\/]+)$/.exec(url.pathname)
+      if (userReg) return `${randomInstance}/user/${userReg[1]}${url.search}`
+
+      const galleryReg = /^\/.*?\/gallery(\/$|$)$/.exec(url.pathname)
+      if (galleryReg) return `${randomInstance}/user/${userReg[1]}?a=gallery`
+
+      return `${randomInstance}${url.pathname}${url.search}`
+    }
     case "piped":
     case "pipedMaterial":
     case "cloudtube":
@@ -804,6 +818,7 @@ const defaultInstances = {
   freetar: ["https://freetar.de"],
   ratAintTieba: ["https://rat.fis.land"],
   shoelace: ["https://shoelace.mint.lgbt"],
+  skunkyArt: ["https://skunky.bloat.cat/"],
 }
 
 function initDefaults() {