about summary refs log tree commit diff stats
path: root/src/assets/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/assets/javascripts')
-rw-r--r--src/assets/javascripts/services.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js
index 69c6935f..6ed77621 100644
--- a/src/assets/javascripts/services.js
+++ b/src/assets/javascripts/services.js
@@ -517,6 +517,24 @@ function redirect(url, type, initiator, forceRedirection) {
 			}
 			return `${randomInstance}${url.pathname}${url.search}`
 		}
+		case "tuboYoutube": {
+			if (url.pathname.startsWith("/channel")) {
+				return `${randomInstance}/channel?url=${encodeURIComponent(url.href)}`
+			}
+			if (url.pathname.startsWith("/watch")) {
+				return `${randomInstance}/stream?url=${encodeURIComponent(url.href)}`
+			}
+			return `${randomInstance}`
+		}
+		case "tuboSoundcloud": {
+			if (url.pathname.match(/\/user[^\/]+(\/$|$)/)) {
+				return `${randomInstance}/channel?url=${encodeURIComponent(url.href)}`
+			}
+			if (url.pathname.match(/\/user[^\/]+\/[^\/]+/)) {
+				return `${randomInstance}/stream?url=${encodeURIComponent(url.href)}`
+			}
+			return `${randomInstance}`
+		}
 		default: {
 			return `${randomInstance}${url.pathname}${url.search}`
 		}
@@ -670,7 +688,9 @@ const defaultInstances = {
 	'destructables': ['https://ds.vern.cc'],
 	'wtfismyip': ['https://myip.wtf'],
 	'safetwitch': ['https://safetwitch.drgns.space'],
-	'proxigram': ['https://proxigram.privacyfrontends.repl.co']
+	'proxigram': ['https://proxigram.privacyfrontends.repl.co'],
+	'tuboYoutube': ['https://tubo.migalmoreno.com'],
+	'tuboSoundcloud': ['https://tubo.migalmoreno.com'],
 }
 
 function initDefaults() {