From 7f9724477527c09dd00c6e1d46fed12c42ef6ba8 Mon Sep 17 00:00:00 2001 From: ManeraKai Date: Sun, 17 Sep 2023 18:53:55 +0300 Subject: Added Tubo https://github.com/libredirect/browser_extension/issues/783 --- src/assets/javascripts/services.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/assets/javascripts/services.js') 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() { -- cgit 1.4.1