mirror of
https://github.com/benbusby/farside.git
synced 2025-03-14 03:06:31 -04:00
Compare commits
51 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
6822d25fd6 | ||
![]() |
26b6a0d53b | ||
![]() |
ece6e525ef | ||
![]() |
1525c5df0a | ||
![]() |
a8c11f05e7 | ||
![]() |
e00ab4d092 | ||
![]() |
88f68ca37e | ||
![]() |
25b4ccc6d3 | ||
![]() |
ecf9baaba6 | ||
![]() |
d1c724905f | ||
![]() |
ea20a3f909 | ||
![]() |
3e2ae8117a | ||
![]() |
deb5cd20cd | ||
![]() |
90f2fe404e | ||
![]() |
76d20b1aa6 | ||
![]() |
8d9089a592 | ||
![]() |
6970db9c5b | ||
![]() |
d15e05d39e | ||
![]() |
99e5dfcac2 | ||
![]() |
356ea3b3c2 | ||
![]() |
e2ac4a20f8 | ||
![]() |
f3ab726cec | ||
![]() |
4b19ad5228 | ||
![]() |
37b0df5c36 | ||
![]() |
8978b9bc73 | ||
![]() |
b71075216e | ||
![]() |
deb1cd62ae | ||
![]() |
ef2e71971f | ||
![]() |
746f8ec0bc | ||
![]() |
fc93ddbb3e | ||
![]() |
b961c60041 | ||
![]() |
22c172f27a | ||
![]() |
c948bebd7c | ||
![]() |
c12f8c8435 | ||
![]() |
900a043e6c | ||
![]() |
8b8baca99a | ||
![]() |
62875f6edc | ||
![]() |
b0879526fd | ||
![]() |
3490639f03 | ||
![]() |
e4fdef870f | ||
![]() |
481c348891 | ||
![]() |
f492e5bb18 | ||
![]() |
d5f1aa4575 | ||
![]() |
f946a2d977 | ||
![]() |
44f9f9e59f | ||
![]() |
42afcb4b9f | ||
![]() |
d42668a621 | ||
![]() |
c02ebcebfb | ||
![]() |
fd723b0b05 | ||
![]() |
70d06396e4 | ||
![]() |
4d9824e8a1 |
@ -1,4 +0,0 @@
|
|||||||
# Used by "mix format"
|
|
||||||
[
|
|
||||||
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
|
|
||||||
]
|
|
6
.github/workflows/update-instances.yml
vendored
6
.github/workflows/update-instances.yml
vendored
@ -251,12 +251,6 @@ jobs:
|
|||||||
.clearnet] |
|
.clearnet] |
|
||||||
sort' > librey-tmp.json
|
sort' > librey-tmp.json
|
||||||
|
|
||||||
jq --slurpfile librex librey-tmp.json \
|
|
||||||
'( .[] | select(.type == "librex") )
|
|
||||||
.instances |= $librex[0]' services-full.json > services-tmp.json
|
|
||||||
|
|
||||||
mv services-tmp.json services-full.json
|
|
||||||
|
|
||||||
jq --slurpfile librey librey-tmp.json \
|
jq --slurpfile librey librey-tmp.json \
|
||||||
'( .[] | select(.type == "librey") )
|
'( .[] | select(.type == "librey") )
|
||||||
.instances |= $librey[0]' services-full.json > services-tmp.json
|
.instances |= $librey[0]' services-full.json > services-tmp.json
|
||||||
|
17
db/cron.go
17
db/cron.go
@ -7,6 +7,7 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"slices"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -18,9 +19,14 @@ const defaultPrimary = "https://farside.link/state"
|
|||||||
const defaultCFPrimary = "https://cf.farside.link/state"
|
const defaultCFPrimary = "https://cf.farside.link/state"
|
||||||
|
|
||||||
var LastUpdate time.Time
|
var LastUpdate time.Time
|
||||||
|
var skipInstanceChecks = []string{
|
||||||
|
"searx",
|
||||||
|
"searxng",
|
||||||
|
}
|
||||||
|
|
||||||
func InitCronTasks() {
|
func InitCronTasks() {
|
||||||
log.Println("Initializing cron tasks...")
|
log.Println("Initializing cron tasks...")
|
||||||
|
updateServiceList()
|
||||||
|
|
||||||
cronDisabled := os.Getenv("FARSIDE_CRON")
|
cronDisabled := os.Getenv("FARSIDE_CRON")
|
||||||
if len(cronDisabled) == 0 || cronDisabled == "1" {
|
if len(cronDisabled) == 0 || cronDisabled == "1" {
|
||||||
@ -58,6 +64,8 @@ func queryServiceInstances() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, service := range services.ServiceList {
|
for _, service := range services.ServiceList {
|
||||||
|
canSkip := slices.Contains[[]string, string](skipInstanceChecks, service.Type)
|
||||||
|
|
||||||
fmt.Printf("===== %s =====\n", service.Type)
|
fmt.Printf("===== %s =====\n", service.Type)
|
||||||
var instances []string
|
var instances []string
|
||||||
for _, instance := range service.Instances {
|
for _, instance := range service.Instances {
|
||||||
@ -68,7 +76,7 @@ func queryServiceInstances() {
|
|||||||
available := queryServiceInstance(
|
available := queryServiceInstance(
|
||||||
instance,
|
instance,
|
||||||
testURL,
|
testURL,
|
||||||
)
|
canSkip)
|
||||||
|
|
||||||
if available {
|
if available {
|
||||||
instances = append(instances, instance)
|
instances = append(instances, instance)
|
||||||
@ -105,12 +113,17 @@ func fetchInstancesFromPrimary() ([]services.Service, error) {
|
|||||||
return serviceList, err
|
return serviceList, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func queryServiceInstance(instance, testURL string) bool {
|
func queryServiceInstance(instance, testURL string, canSkipCheck bool) bool {
|
||||||
testMode := os.Getenv("FARSIDE_TEST")
|
testMode := os.Getenv("FARSIDE_TEST")
|
||||||
if len(testMode) > 0 && testMode == "1" {
|
if len(testMode) > 0 && testMode == "1" {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if canSkipCheck {
|
||||||
|
fmt.Printf(" [INFO] Adding %s\n", instance)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
ua := "Mozilla/5.0 (compatible; Farside/1.0.0; +https://farside.link)"
|
ua := "Mozilla/5.0 (compatible; Farside/1.0.0; +https://farside.link)"
|
||||||
url := instance + testURL
|
url := instance + testURL
|
||||||
|
|
||||||
|
2
main.go
2
main.go
@ -24,7 +24,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
db.InitCronTasks()
|
go db.InitCronTasks()
|
||||||
|
|
||||||
signalChan := make(chan os.Signal, 1)
|
signalChan := make(chan os.Signal, 1)
|
||||||
signal.Notify(signalChan, os.Interrupt, syscall.SIGTERM)
|
signal.Notify(signalChan, os.Interrupt, syscall.SIGTERM)
|
||||||
|
@ -3,6 +3,7 @@ package server
|
|||||||
import (
|
import (
|
||||||
_ "embed"
|
_ "embed"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
@ -61,22 +62,22 @@ func state(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func baseRouting(w http.ResponseWriter, r *http.Request) {
|
func baseRouting(w http.ResponseWriter, r *http.Request) {
|
||||||
routing(w, r, false)
|
routing(w, r, false, r.URL.RawQuery)
|
||||||
}
|
}
|
||||||
|
|
||||||
func jsRouting(w http.ResponseWriter, r *http.Request) {
|
func jsRouting(w http.ResponseWriter, r *http.Request) {
|
||||||
r.URL.Path = strings.Replace(r.URL.Path, "/_", "", 1)
|
r.URL.Path = strings.Replace(r.URL.Path, "/_", "", 1)
|
||||||
routing(w, r, true)
|
routing(w, r, true, r.URL.RawQuery)
|
||||||
}
|
}
|
||||||
|
|
||||||
func routing(w http.ResponseWriter, r *http.Request, jsEnabled bool) {
|
func routing(w http.ResponseWriter, r *http.Request, jsEnabled bool, query string) {
|
||||||
value := r.PathValue("routing")
|
value := r.PathValue("routing")
|
||||||
if len(value) == 0 {
|
if len(value) == 0 {
|
||||||
value = r.URL.Path
|
value = r.URL.Path
|
||||||
}
|
}
|
||||||
|
|
||||||
url, _ := url.Parse(value)
|
parsedURL, _ := url.Parse(value)
|
||||||
path := strings.TrimPrefix(url.Path, "/")
|
path := strings.TrimPrefix(parsedURL.Path, "/")
|
||||||
segments := strings.Split(path, "/")
|
segments := strings.Split(path, "/")
|
||||||
|
|
||||||
if len(segments[0]) == 0 {
|
if len(segments[0]) == 0 {
|
||||||
@ -85,8 +86,9 @@ func routing(w http.ResponseWriter, r *http.Request, jsEnabled bool) {
|
|||||||
|
|
||||||
target, err := services.MatchRequest(segments[0])
|
target, err := services.MatchRequest(segments[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
errMsg := fmt.Sprintf("No routing found for '%s'", segments[0])
|
||||||
log.Printf("Error during match request: %v\n", err)
|
log.Printf("Error during match request: %v\n", err)
|
||||||
http.Error(w, "No routing found for "+target, http.StatusBadRequest)
|
http.Error(w, errMsg, http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,6 +121,7 @@ func routing(w http.ResponseWriter, r *http.Request, jsEnabled bool) {
|
|||||||
w.Header().Set("Pragma", "no-cache")
|
w.Header().Set("Pragma", "no-cache")
|
||||||
w.Header().Set("Expires", "0")
|
w.Header().Set("Expires", "0")
|
||||||
|
|
||||||
|
instance += fmt.Sprintf("?%s", query)
|
||||||
if jsEnabled {
|
if jsEnabled {
|
||||||
data := routeData{
|
data := routeData{
|
||||||
InstanceURL: instance,
|
InstanceURL: instance,
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
"test_url": "/r/popular",
|
"test_url": "/r/popular",
|
||||||
"fallback": "https://redlib.freedit.eu",
|
"fallback": "https://redlib.freedit.eu",
|
||||||
"instances": [
|
"instances": [
|
||||||
"https://l.opnxng.com",
|
"https://libreddit.privacydev.net",
|
||||||
"https://r.darrennathanael.com",
|
|
||||||
"https://red.arancia.click",
|
"https://red.arancia.click",
|
||||||
"https://red.artemislena.eu",
|
"https://red.artemislena.eu",
|
||||||
"https://red.ngn.tf",
|
"https://red.ngn.tf",
|
||||||
"https://reddit.nerdvpn.de",
|
"https://reddit.nerdvpn.de",
|
||||||
|
"https://redlib.baczek.me",
|
||||||
"https://redlib.catsarch.com",
|
"https://redlib.catsarch.com",
|
||||||
"https://redlib.ducks.party",
|
"https://redlib.ducks.party",
|
||||||
"https://redlib.kittywi.re",
|
"https://redlib.kittywi.re",
|
||||||
@ -17,10 +17,9 @@
|
|||||||
"https://redlib.perennialte.ch",
|
"https://redlib.perennialte.ch",
|
||||||
"https://redlib.privacy.com.de",
|
"https://redlib.privacy.com.de",
|
||||||
"https://redlib.privacyredirect.com",
|
"https://redlib.privacyredirect.com",
|
||||||
"https://redlib.r4fo.com",
|
"https://redlib.private.coffee",
|
||||||
"https://rl.bloat.cat",
|
"https://redlib.seasi.dev",
|
||||||
"https://rl.rootdo.com",
|
"https://rl.bloat.cat"
|
||||||
"https://safereddit.com"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -28,12 +27,12 @@
|
|||||||
"test_url": "/r/popular",
|
"test_url": "/r/popular",
|
||||||
"fallback": "https://redlib.freedit.eu",
|
"fallback": "https://redlib.freedit.eu",
|
||||||
"instances": [
|
"instances": [
|
||||||
"https://l.opnxng.com",
|
"https://libreddit.privacydev.net",
|
||||||
"https://r.darrennathanael.com",
|
|
||||||
"https://red.arancia.click",
|
"https://red.arancia.click",
|
||||||
"https://red.artemislena.eu",
|
"https://red.artemislena.eu",
|
||||||
"https://red.ngn.tf",
|
"https://red.ngn.tf",
|
||||||
"https://reddit.nerdvpn.de",
|
"https://reddit.nerdvpn.de",
|
||||||
|
"https://redlib.baczek.me",
|
||||||
"https://redlib.catsarch.com",
|
"https://redlib.catsarch.com",
|
||||||
"https://redlib.ducks.party",
|
"https://redlib.ducks.party",
|
||||||
"https://redlib.kittywi.re",
|
"https://redlib.kittywi.re",
|
||||||
@ -41,10 +40,9 @@
|
|||||||
"https://redlib.perennialte.ch",
|
"https://redlib.perennialte.ch",
|
||||||
"https://redlib.privacy.com.de",
|
"https://redlib.privacy.com.de",
|
||||||
"https://redlib.privacyredirect.com",
|
"https://redlib.privacyredirect.com",
|
||||||
"https://redlib.r4fo.com",
|
"https://redlib.private.coffee",
|
||||||
"https://rl.bloat.cat",
|
"https://redlib.seasi.dev",
|
||||||
"https://rl.rootdo.com",
|
"https://rl.bloat.cat"
|
||||||
"https://safereddit.com"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -99,9 +97,7 @@
|
|||||||
"test_url": "/watch?v=eBGIQ7ZuuiU",
|
"test_url": "/watch?v=eBGIQ7ZuuiU",
|
||||||
"fallback": "https://invidious.snopyta.org",
|
"fallback": "https://invidious.snopyta.org",
|
||||||
"instances": [
|
"instances": [
|
||||||
"https://inv.nadeko.net",
|
"https://inv.nadeko.net"
|
||||||
"https://invidious.nerdvpn.de",
|
|
||||||
"https://yewtu.be"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -135,8 +131,11 @@
|
|||||||
"fallback": "https://nitter.net",
|
"fallback": "https://nitter.net",
|
||||||
"instances": [
|
"instances": [
|
||||||
"https://lightbrd.com",
|
"https://lightbrd.com",
|
||||||
|
"https://nitter.net",
|
||||||
"https://nitter.poast.org",
|
"https://nitter.poast.org",
|
||||||
"https://nitter.privacydev.net",
|
"https://nitter.privacydev.net",
|
||||||
|
"https://nitter.privacyredirect.com",
|
||||||
|
"https://nitter.space",
|
||||||
"https://xcancel.com"
|
"https://xcancel.com"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -209,10 +208,12 @@
|
|||||||
"https://i.habedieeh.re",
|
"https://i.habedieeh.re",
|
||||||
"https://imgur.010032.xyz",
|
"https://imgur.010032.xyz",
|
||||||
"https://imgur.artemislena.eu",
|
"https://imgur.artemislena.eu",
|
||||||
|
"https://imgur.fsky.io",
|
||||||
"https://imgur.nerdvpn.de",
|
"https://imgur.nerdvpn.de",
|
||||||
"https://ri.nadeko.net",
|
"https://ri.nadeko.net",
|
||||||
"https://rimgo.4o1x5.dev",
|
"https://rimgo.4o1x5.dev",
|
||||||
"https://rimgo.aketawi.space",
|
"https://rimgo.aketawi.space",
|
||||||
|
"https://rimgo.astrial.org",
|
||||||
"https://rimgo.bloat.cat",
|
"https://rimgo.bloat.cat",
|
||||||
"https://rimgo.bus-hit.me",
|
"https://rimgo.bus-hit.me",
|
||||||
"https://rimgo.canine.tools",
|
"https://rimgo.canine.tools",
|
||||||
@ -238,7 +239,6 @@
|
|||||||
"https://rimgo.thebunny.zone",
|
"https://rimgo.thebunny.zone",
|
||||||
"https://rimgo.totaldarkness.net",
|
"https://rimgo.totaldarkness.net",
|
||||||
"https://rimgo.us.projectsegfau.lt",
|
"https://rimgo.us.projectsegfau.lt",
|
||||||
"https://rimgo.whateveritworks.org",
|
|
||||||
"https://rmgur.com"
|
"https://rmgur.com"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -247,30 +247,12 @@
|
|||||||
"test_url": "/search?cookies_disabled=1&q=<%=query%>",
|
"test_url": "/search?cookies_disabled=1&q=<%=query%>",
|
||||||
"fallback": "https://search.sethforprivacy.com",
|
"fallback": "https://search.sethforprivacy.com",
|
||||||
"instances": [
|
"instances": [
|
||||||
"https://gowogle.voring.me",
|
|
||||||
"https://s.tokhmi.xyz",
|
|
||||||
"https://search.albony.xyz",
|
|
||||||
"https://search.dr460nf1r3.org",
|
|
||||||
"https://search.garudalinux.org",
|
"https://search.garudalinux.org",
|
||||||
"https://search.nezumi.party",
|
|
||||||
"https://search.notrustverify.ch",
|
|
||||||
"https://search.sethforprivacy.com",
|
"https://search.sethforprivacy.com",
|
||||||
"https://search.snine.nl",
|
|
||||||
"https://wg.vern.cc",
|
"https://wg.vern.cc",
|
||||||
"https://wgl.frail.duckdns.org",
|
"https://whoogle.4040940.xyz",
|
||||||
"https://whoogle-search--replitcomreside.repl.co",
|
|
||||||
"https://whoogle.datura.network",
|
|
||||||
"https://whoogle.dcs0.hu",
|
|
||||||
"https://whoogle.ftw.lol",
|
|
||||||
"https://whoogle.hostux.net",
|
|
||||||
"https://whoogle.hxvy0.gq",
|
|
||||||
"https://whoogle.lunar.icu",
|
"https://whoogle.lunar.icu",
|
||||||
"https://whoogle.no-logs.com",
|
"https://whoogle.privacydev.net"
|
||||||
"https://whoogle.privacydev.net",
|
|
||||||
"https://whoogle.ungovernable.men",
|
|
||||||
"https://whoogle.yepserver.xyz",
|
|
||||||
"https://whoogle2.ungovernable.men",
|
|
||||||
"https://whoogle3.ungovernable.men"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -300,38 +282,37 @@
|
|||||||
"https://opnxng.com",
|
"https://opnxng.com",
|
||||||
"https://paulgo.io",
|
"https://paulgo.io",
|
||||||
"https://priv.au",
|
"https://priv.au",
|
||||||
|
"https://s.datuan.dev",
|
||||||
"https://s.mble.dk",
|
"https://s.mble.dk",
|
||||||
"https://search.080609.xyz",
|
"https://search.080609.xyz",
|
||||||
"https://search.blitzw.in",
|
|
||||||
"https://search.canine.tools",
|
"https://search.canine.tools",
|
||||||
"https://search.catboy.house",
|
"https://search.catboy.house",
|
||||||
"https://search.citw.lgbt",
|
|
||||||
"https://search.einfachzocken.eu",
|
"https://search.einfachzocken.eu",
|
||||||
"https://search.gcomm.ch",
|
"https://search.gcomm.ch",
|
||||||
"https://search.im-in.space",
|
"https://search.im-in.space",
|
||||||
"https://search.ipv6s.net",
|
"https://search.ipv6s.net",
|
||||||
"https://search.leptons.xyz",
|
"https://search.leptons.xyz",
|
||||||
"https://search.mdosch.de",
|
"https://search.mdosch.de",
|
||||||
"https://search.nadeko.net",
|
|
||||||
"https://search.nerdvpn.de",
|
"https://search.nerdvpn.de",
|
||||||
"https://search.ononoki.org",
|
"https://search.ononoki.org",
|
||||||
"https://search.privacyredirect.com",
|
|
||||||
"https://search.projectsegfau.lt",
|
"https://search.projectsegfau.lt",
|
||||||
"https://search.rhscz.eu",
|
"https://search.rhscz.eu",
|
||||||
"https://search.rowie.at",
|
"https://search.rowie.at",
|
||||||
"https://search.sapti.me",
|
"https://search.sapti.me",
|
||||||
|
"https://search.tinfoil.ch",
|
||||||
"https://search.url4irl.com",
|
"https://search.url4irl.com",
|
||||||
"https://searx.ankha.ac",
|
"https://searx.ankha.ac",
|
||||||
"https://searx.be",
|
"https://searx.be",
|
||||||
"https://searx.dresden.network",
|
"https://searx.dresden.network",
|
||||||
"https://searx.electroncash.de",
|
|
||||||
"https://searx.foobar.vip",
|
"https://searx.foobar.vip",
|
||||||
"https://searx.foss.family",
|
"https://searx.foss.family",
|
||||||
"https://searx.namejeff.xyz",
|
"https://searx.namejeff.xyz",
|
||||||
|
"https://searx.oloke.xyz",
|
||||||
"https://searx.ox2.fr",
|
"https://searx.ox2.fr",
|
||||||
|
"https://searx.perennialte.ch",
|
||||||
"https://searx.rhscz.eu",
|
"https://searx.rhscz.eu",
|
||||||
"https://searx.tiekoetter.com",
|
"https://searx.tiekoetter.com",
|
||||||
"https://searxng.hweeren.com",
|
"https://searxng.f24o.zip",
|
||||||
"https://searxng.shreven.org",
|
"https://searxng.shreven.org",
|
||||||
"https://searxng.site",
|
"https://searxng.site",
|
||||||
"https://searxng.world",
|
"https://searxng.world",
|
||||||
@ -391,41 +372,6 @@
|
|||||||
"https://cringe.whateveritworks.org"
|
"https://cringe.whateveritworks.org"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "librex",
|
|
||||||
"test_url": "/search.php?q=<%=query%>",
|
|
||||||
"fallback": "https://librex.myroware.eu",
|
|
||||||
"instances": [
|
|
||||||
"https://glass.prpl.wtf",
|
|
||||||
"https://libre-find.online",
|
|
||||||
"https://libre.blitzw.in",
|
|
||||||
"https://librex.nohost.network",
|
|
||||||
"https://librex.uk.to",
|
|
||||||
"https://librey.4o1x5.dev",
|
|
||||||
"https://librey.baczek.me",
|
|
||||||
"https://librey.darkness.services",
|
|
||||||
"https://librey.franklyflawless.org",
|
|
||||||
"https://librey.ix.tc",
|
|
||||||
"https://librey.milivojevic.in.rs",
|
|
||||||
"https://librey.myroware.net",
|
|
||||||
"https://librey.nirn.quest",
|
|
||||||
"https://librey.org",
|
|
||||||
"https://librey.retro-hax.net",
|
|
||||||
"https://lx.benike.me",
|
|
||||||
"https://ly.owo.si",
|
|
||||||
"https://search.ahwx.org",
|
|
||||||
"https://search.davidovski.xyz",
|
|
||||||
"https://search.funami.tech",
|
|
||||||
"https://search.pabloferreiro.es",
|
|
||||||
"https://search.revvy.de",
|
|
||||||
"https://search.seitan-ayoub.lol",
|
|
||||||
"https://search.technicalvoid.dev",
|
|
||||||
"https://search.uwabaki.party",
|
|
||||||
"https://search.zeroish.xyz",
|
|
||||||
"https://search2.ahwx.org",
|
|
||||||
"https://serp.catswords.net"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "quetre",
|
"type": "quetre",
|
||||||
"test_url": "/How-does-the-Z-boson-decay",
|
"test_url": "/How-does-the-Z-boson-decay",
|
||||||
@ -589,33 +535,21 @@
|
|||||||
"test_url": "/search.php?q=<%=query%>",
|
"test_url": "/search.php?q=<%=query%>",
|
||||||
"fallback": "https://search.ahwx.org",
|
"fallback": "https://search.ahwx.org",
|
||||||
"instances": [
|
"instances": [
|
||||||
"https://glass.prpl.wtf",
|
|
||||||
"https://libre-find.online",
|
|
||||||
"https://libre.blitzw.in",
|
"https://libre.blitzw.in",
|
||||||
"https://librex.nohost.network",
|
"https://librex.nohost.network",
|
||||||
"https://librex.uk.to",
|
|
||||||
"https://librey.4o1x5.dev",
|
"https://librey.4o1x5.dev",
|
||||||
"https://librey.baczek.me",
|
"https://librey.baczek.me",
|
||||||
"https://librey.darkness.services",
|
"https://librey.darkness.services",
|
||||||
"https://librey.franklyflawless.org",
|
"https://librey.nube-gran.de",
|
||||||
"https://librey.ix.tc",
|
|
||||||
"https://librey.milivojevic.in.rs",
|
|
||||||
"https://librey.myroware.net",
|
|
||||||
"https://librey.nirn.quest",
|
|
||||||
"https://librey.org",
|
"https://librey.org",
|
||||||
"https://librey.retro-hax.net",
|
"https://librey.sny.sh",
|
||||||
"https://lx.benike.me",
|
|
||||||
"https://ly.owo.si",
|
"https://ly.owo.si",
|
||||||
"https://search.ahwx.org",
|
|
||||||
"https://search.davidovski.xyz",
|
"https://search.davidovski.xyz",
|
||||||
"https://search.funami.tech",
|
"https://search.funami.tech",
|
||||||
"https://search.pabloferreiro.es",
|
"https://search.liv.town",
|
||||||
"https://search.revvy.de",
|
"https://search.revvy.de",
|
||||||
"https://search.seitan-ayoub.lol",
|
|
||||||
"https://search.technicalvoid.dev",
|
"https://search.technicalvoid.dev",
|
||||||
"https://search.uwabaki.party",
|
"https://search.uwabaki.party",
|
||||||
"https://search.zeroish.xyz",
|
|
||||||
"https://search2.ahwx.org",
|
|
||||||
"https://serp.catswords.net"
|
"https://serp.catswords.net"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -627,6 +561,7 @@
|
|||||||
"https://bandcamp.lurkmore.com",
|
"https://bandcamp.lurkmore.com",
|
||||||
"https://tent.bloat.cat",
|
"https://tent.bloat.cat",
|
||||||
"https://tent.deep-swarm.xyz",
|
"https://tent.deep-swarm.xyz",
|
||||||
|
"https://tent.qunn.link",
|
||||||
"https://tent.sny.sh",
|
"https://tent.sny.sh",
|
||||||
"https://tn.vern.cc"
|
"https://tn.vern.cc"
|
||||||
]
|
]
|
||||||
|
114
services.json
114
services.json
@ -4,21 +4,21 @@
|
|||||||
"test_url": "/r/popular",
|
"test_url": "/r/popular",
|
||||||
"fallback": "https://redlib.freedit.eu",
|
"fallback": "https://redlib.freedit.eu",
|
||||||
"instances": [
|
"instances": [
|
||||||
"https://l.opnxng.com",
|
"https://libreddit.privacydev.net",
|
||||||
"https://r.darrennathanael.com",
|
|
||||||
"https://red.arancia.click",
|
"https://red.arancia.click",
|
||||||
"https://red.artemislena.eu",
|
"https://red.artemislena.eu",
|
||||||
"https://red.ngn.tf",
|
"https://red.ngn.tf",
|
||||||
"https://reddit.nerdvpn.de",
|
"https://reddit.nerdvpn.de",
|
||||||
|
"https://redlib.baczek.me",
|
||||||
"https://redlib.catsarch.com",
|
"https://redlib.catsarch.com",
|
||||||
"https://redlib.ducks.party",
|
"https://redlib.ducks.party",
|
||||||
"https://redlib.kittywi.re",
|
"https://redlib.kittywi.re",
|
||||||
"https://redlib.nadeko.net",
|
"https://redlib.nadeko.net",
|
||||||
"https://redlib.privacy.com.de",
|
"https://redlib.privacy.com.de",
|
||||||
"https://redlib.privacyredirect.com",
|
"https://redlib.privacyredirect.com",
|
||||||
"https://rl.bloat.cat",
|
"https://redlib.private.coffee",
|
||||||
"https://rl.rootdo.com",
|
"https://redlib.seasi.dev",
|
||||||
"https://safereddit.com"
|
"https://rl.bloat.cat"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -26,21 +26,21 @@
|
|||||||
"test_url": "/r/popular",
|
"test_url": "/r/popular",
|
||||||
"fallback": "https://redlib.freedit.eu",
|
"fallback": "https://redlib.freedit.eu",
|
||||||
"instances": [
|
"instances": [
|
||||||
"https://l.opnxng.com",
|
"https://libreddit.privacydev.net",
|
||||||
"https://r.darrennathanael.com",
|
|
||||||
"https://red.arancia.click",
|
"https://red.arancia.click",
|
||||||
"https://red.artemislena.eu",
|
"https://red.artemislena.eu",
|
||||||
"https://red.ngn.tf",
|
"https://red.ngn.tf",
|
||||||
"https://reddit.nerdvpn.de",
|
"https://reddit.nerdvpn.de",
|
||||||
|
"https://redlib.baczek.me",
|
||||||
"https://redlib.catsarch.com",
|
"https://redlib.catsarch.com",
|
||||||
"https://redlib.ducks.party",
|
"https://redlib.ducks.party",
|
||||||
"https://redlib.kittywi.re",
|
"https://redlib.kittywi.re",
|
||||||
"https://redlib.nadeko.net",
|
"https://redlib.nadeko.net",
|
||||||
"https://redlib.privacy.com.de",
|
"https://redlib.privacy.com.de",
|
||||||
"https://redlib.privacyredirect.com",
|
"https://redlib.privacyredirect.com",
|
||||||
"https://rl.bloat.cat",
|
"https://redlib.private.coffee",
|
||||||
"https://rl.rootdo.com",
|
"https://redlib.seasi.dev",
|
||||||
"https://safereddit.com"
|
"https://rl.bloat.cat"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -80,6 +80,7 @@
|
|||||||
"https://ig.opnxng.com",
|
"https://ig.opnxng.com",
|
||||||
"https://proxigram.lunar.icu",
|
"https://proxigram.lunar.icu",
|
||||||
"https://gram.whatever.social",
|
"https://gram.whatever.social",
|
||||||
|
"https://ig.snine.nl",
|
||||||
"https://ig.floppa.one",
|
"https://ig.floppa.one",
|
||||||
"https://proxigram.kyun.li"
|
"https://proxigram.kyun.li"
|
||||||
]
|
]
|
||||||
@ -89,9 +90,7 @@
|
|||||||
"test_url": "/watch?v=eBGIQ7ZuuiU",
|
"test_url": "/watch?v=eBGIQ7ZuuiU",
|
||||||
"fallback": "https://invidious.snopyta.org",
|
"fallback": "https://invidious.snopyta.org",
|
||||||
"instances": [
|
"instances": [
|
||||||
"https://inv.nadeko.net",
|
"https://inv.nadeko.net"
|
||||||
"https://invidious.nerdvpn.de",
|
|
||||||
"https://yewtu.be"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -118,8 +117,10 @@
|
|||||||
"test_url": "/jack/status/20",
|
"test_url": "/jack/status/20",
|
||||||
"fallback": "https://nitter.net",
|
"fallback": "https://nitter.net",
|
||||||
"instances": [
|
"instances": [
|
||||||
|
"https://nitter.net",
|
||||||
"https://nitter.poast.org",
|
"https://nitter.poast.org",
|
||||||
"https://nitter.privacydev.net",
|
"https://nitter.privacydev.net",
|
||||||
|
"https://nitter.privacyredirect.com",
|
||||||
"https://xcancel.com"
|
"https://xcancel.com"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -188,9 +189,11 @@
|
|||||||
"https://i.habedieeh.re",
|
"https://i.habedieeh.re",
|
||||||
"https://imgur.010032.xyz",
|
"https://imgur.010032.xyz",
|
||||||
"https://imgur.artemislena.eu",
|
"https://imgur.artemislena.eu",
|
||||||
|
"https://imgur.fsky.io",
|
||||||
"https://imgur.nerdvpn.de",
|
"https://imgur.nerdvpn.de",
|
||||||
"https://ri.nadeko.net",
|
"https://ri.nadeko.net",
|
||||||
"https://rimgo.4o1x5.dev",
|
"https://rimgo.4o1x5.dev",
|
||||||
|
"https://rimgo.astrial.org",
|
||||||
"https://rimgo.bloat.cat",
|
"https://rimgo.bloat.cat",
|
||||||
"https://rimgo.bus-hit.me",
|
"https://rimgo.bus-hit.me",
|
||||||
"https://rimgo.canine.tools",
|
"https://rimgo.canine.tools",
|
||||||
@ -206,6 +209,7 @@
|
|||||||
"https://rimgo.in.projectsegfau.lt",
|
"https://rimgo.in.projectsegfau.lt",
|
||||||
"https://rimgo.lunar.icu",
|
"https://rimgo.lunar.icu",
|
||||||
"https://rimgo.nohost.network",
|
"https://rimgo.nohost.network",
|
||||||
|
"https://rimgo.perennialte.ch",
|
||||||
"https://rimgo.privacyredirect.com",
|
"https://rimgo.privacyredirect.com",
|
||||||
"https://rimgo.projectsegfau.lt",
|
"https://rimgo.projectsegfau.lt",
|
||||||
"https://rimgo.pussthecat.org",
|
"https://rimgo.pussthecat.org",
|
||||||
@ -214,7 +218,6 @@
|
|||||||
"https://rimgo.thebunny.zone",
|
"https://rimgo.thebunny.zone",
|
||||||
"https://rimgo.totaldarkness.net",
|
"https://rimgo.totaldarkness.net",
|
||||||
"https://rimgo.us.projectsegfau.lt",
|
"https://rimgo.us.projectsegfau.lt",
|
||||||
"https://rimgo.whateveritworks.org",
|
|
||||||
"https://rmgur.com"
|
"https://rmgur.com"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -223,25 +226,10 @@
|
|||||||
"test_url": "/search?cookies_disabled=1&q=<%=query%>",
|
"test_url": "/search?cookies_disabled=1&q=<%=query%>",
|
||||||
"fallback": "https://search.sethforprivacy.com",
|
"fallback": "https://search.sethforprivacy.com",
|
||||||
"instances": [
|
"instances": [
|
||||||
"https://gowogle.voring.me",
|
|
||||||
"https://s.tokhmi.xyz",
|
|
||||||
"https://search.albony.xyz",
|
|
||||||
"https://search.dr460nf1r3.org",
|
|
||||||
"https://search.nezumi.party",
|
|
||||||
"https://search.notrustverify.ch",
|
|
||||||
"https://search.sethforprivacy.com",
|
"https://search.sethforprivacy.com",
|
||||||
"https://wg.vern.cc",
|
"https://wg.vern.cc",
|
||||||
"https://wgl.frail.duckdns.org",
|
|
||||||
"https://whoogle-search--replitcomreside.repl.co",
|
|
||||||
"https://whoogle.datura.network",
|
|
||||||
"https://whoogle.dcs0.hu",
|
|
||||||
"https://whoogle.ftw.lol",
|
|
||||||
"https://whoogle.hostux.net",
|
|
||||||
"https://whoogle.hxvy0.gq",
|
|
||||||
"https://whoogle.lunar.icu",
|
"https://whoogle.lunar.icu",
|
||||||
"https://whoogle.no-logs.com",
|
"https://whoogle.privacydev.net"
|
||||||
"https://whoogle.privacydev.net",
|
|
||||||
"https://whoogle.yepserver.xyz"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -271,38 +259,37 @@
|
|||||||
"https://opnxng.com",
|
"https://opnxng.com",
|
||||||
"https://paulgo.io",
|
"https://paulgo.io",
|
||||||
"https://priv.au",
|
"https://priv.au",
|
||||||
|
"https://s.datuan.dev",
|
||||||
"https://s.mble.dk",
|
"https://s.mble.dk",
|
||||||
"https://search.080609.xyz",
|
"https://search.080609.xyz",
|
||||||
"https://search.blitzw.in",
|
|
||||||
"https://search.canine.tools",
|
"https://search.canine.tools",
|
||||||
"https://search.catboy.house",
|
"https://search.catboy.house",
|
||||||
"https://search.citw.lgbt",
|
|
||||||
"https://search.einfachzocken.eu",
|
"https://search.einfachzocken.eu",
|
||||||
"https://search.gcomm.ch",
|
"https://search.gcomm.ch",
|
||||||
"https://search.im-in.space",
|
"https://search.im-in.space",
|
||||||
"https://search.ipv6s.net",
|
"https://search.ipv6s.net",
|
||||||
"https://search.leptons.xyz",
|
"https://search.leptons.xyz",
|
||||||
"https://search.mdosch.de",
|
"https://search.mdosch.de",
|
||||||
"https://search.nadeko.net",
|
|
||||||
"https://search.nerdvpn.de",
|
"https://search.nerdvpn.de",
|
||||||
"https://search.ononoki.org",
|
"https://search.ononoki.org",
|
||||||
"https://search.privacyredirect.com",
|
|
||||||
"https://search.projectsegfau.lt",
|
"https://search.projectsegfau.lt",
|
||||||
"https://search.rhscz.eu",
|
"https://search.rhscz.eu",
|
||||||
"https://search.rowie.at",
|
"https://search.rowie.at",
|
||||||
"https://search.sapti.me",
|
"https://search.sapti.me",
|
||||||
|
"https://search.tinfoil.ch",
|
||||||
"https://search.url4irl.com",
|
"https://search.url4irl.com",
|
||||||
"https://searx.ankha.ac",
|
"https://searx.ankha.ac",
|
||||||
"https://searx.be",
|
"https://searx.be",
|
||||||
"https://searx.dresden.network",
|
"https://searx.dresden.network",
|
||||||
"https://searx.electroncash.de",
|
|
||||||
"https://searx.foobar.vip",
|
"https://searx.foobar.vip",
|
||||||
"https://searx.foss.family",
|
"https://searx.foss.family",
|
||||||
"https://searx.namejeff.xyz",
|
"https://searx.namejeff.xyz",
|
||||||
|
"https://searx.oloke.xyz",
|
||||||
"https://searx.ox2.fr",
|
"https://searx.ox2.fr",
|
||||||
|
"https://searx.perennialte.ch",
|
||||||
"https://searx.rhscz.eu",
|
"https://searx.rhscz.eu",
|
||||||
"https://searx.tiekoetter.com",
|
"https://searx.tiekoetter.com",
|
||||||
"https://searxng.hweeren.com",
|
"https://searxng.f24o.zip",
|
||||||
"https://searxng.shreven.org",
|
"https://searxng.shreven.org",
|
||||||
"https://searxng.site",
|
"https://searxng.site",
|
||||||
"https://searxng.world",
|
"https://searxng.world",
|
||||||
@ -360,41 +347,6 @@
|
|||||||
"https://cringe.whateveritworks.org"
|
"https://cringe.whateveritworks.org"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "librex",
|
|
||||||
"test_url": "/search.php?q=<%=query%>",
|
|
||||||
"fallback": "https://librex.myroware.eu",
|
|
||||||
"instances": [
|
|
||||||
"https://glass.prpl.wtf",
|
|
||||||
"https://libre-find.online",
|
|
||||||
"https://libre.blitzw.in",
|
|
||||||
"https://librex.nohost.network",
|
|
||||||
"https://librex.uk.to",
|
|
||||||
"https://librey.4o1x5.dev",
|
|
||||||
"https://librey.baczek.me",
|
|
||||||
"https://librey.darkness.services",
|
|
||||||
"https://librey.franklyflawless.org",
|
|
||||||
"https://librey.ix.tc",
|
|
||||||
"https://librey.milivojevic.in.rs",
|
|
||||||
"https://librey.myroware.net",
|
|
||||||
"https://librey.nirn.quest",
|
|
||||||
"https://librey.org",
|
|
||||||
"https://librey.retro-hax.net",
|
|
||||||
"https://lx.benike.me",
|
|
||||||
"https://ly.owo.si",
|
|
||||||
"https://search.ahwx.org",
|
|
||||||
"https://search.davidovski.xyz",
|
|
||||||
"https://search.funami.tech",
|
|
||||||
"https://search.pabloferreiro.es",
|
|
||||||
"https://search.revvy.de",
|
|
||||||
"https://search.seitan-ayoub.lol",
|
|
||||||
"https://search.technicalvoid.dev",
|
|
||||||
"https://search.uwabaki.party",
|
|
||||||
"https://search.zeroish.xyz",
|
|
||||||
"https://search2.ahwx.org",
|
|
||||||
"https://serp.catswords.net"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "quetre",
|
"type": "quetre",
|
||||||
"test_url": "/How-does-the-Z-boson-decay",
|
"test_url": "/How-does-the-Z-boson-decay",
|
||||||
@ -537,6 +489,7 @@
|
|||||||
"https://4get.konakona.moe",
|
"https://4get.konakona.moe",
|
||||||
"https://4get.lunar.icu",
|
"https://4get.lunar.icu",
|
||||||
"https://4get.lvkaszus.pl",
|
"https://4get.lvkaszus.pl",
|
||||||
|
"https://4get.perennialte.ch",
|
||||||
"https://4get.psily.garden",
|
"https://4get.psily.garden",
|
||||||
"https://4get.seitan-ayoub.lol",
|
"https://4get.seitan-ayoub.lol",
|
||||||
"https://4get.silly.computer",
|
"https://4get.silly.computer",
|
||||||
@ -551,33 +504,21 @@
|
|||||||
"test_url": "/search.php?q=<%=query%>",
|
"test_url": "/search.php?q=<%=query%>",
|
||||||
"fallback": "https://search.ahwx.org",
|
"fallback": "https://search.ahwx.org",
|
||||||
"instances": [
|
"instances": [
|
||||||
"https://glass.prpl.wtf",
|
|
||||||
"https://libre-find.online",
|
|
||||||
"https://libre.blitzw.in",
|
"https://libre.blitzw.in",
|
||||||
"https://librex.nohost.network",
|
"https://librex.nohost.network",
|
||||||
"https://librex.uk.to",
|
|
||||||
"https://librey.4o1x5.dev",
|
"https://librey.4o1x5.dev",
|
||||||
"https://librey.baczek.me",
|
"https://librey.baczek.me",
|
||||||
"https://librey.darkness.services",
|
"https://librey.darkness.services",
|
||||||
"https://librey.franklyflawless.org",
|
"https://librey.nube-gran.de",
|
||||||
"https://librey.ix.tc",
|
|
||||||
"https://librey.milivojevic.in.rs",
|
|
||||||
"https://librey.myroware.net",
|
|
||||||
"https://librey.nirn.quest",
|
|
||||||
"https://librey.org",
|
"https://librey.org",
|
||||||
"https://librey.retro-hax.net",
|
"https://librey.sny.sh",
|
||||||
"https://lx.benike.me",
|
|
||||||
"https://ly.owo.si",
|
"https://ly.owo.si",
|
||||||
"https://search.ahwx.org",
|
|
||||||
"https://search.davidovski.xyz",
|
"https://search.davidovski.xyz",
|
||||||
"https://search.funami.tech",
|
"https://search.funami.tech",
|
||||||
"https://search.pabloferreiro.es",
|
"https://search.liv.town",
|
||||||
"https://search.revvy.de",
|
"https://search.revvy.de",
|
||||||
"https://search.seitan-ayoub.lol",
|
|
||||||
"https://search.technicalvoid.dev",
|
"https://search.technicalvoid.dev",
|
||||||
"https://search.uwabaki.party",
|
"https://search.uwabaki.party",
|
||||||
"https://search.zeroish.xyz",
|
|
||||||
"https://search2.ahwx.org",
|
|
||||||
"https://serp.catswords.net"
|
"https://serp.catswords.net"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -589,6 +530,7 @@
|
|||||||
"https://bandcamp.lurkmore.com",
|
"https://bandcamp.lurkmore.com",
|
||||||
"https://tent.bloat.cat",
|
"https://tent.bloat.cat",
|
||||||
"https://tent.deep-swarm.xyz",
|
"https://tent.deep-swarm.xyz",
|
||||||
|
"https://tent.qunn.link",
|
||||||
"https://tent.sny.sh",
|
"https://tent.sny.sh",
|
||||||
"https://tn.vern.cc"
|
"https://tn.vern.cc"
|
||||||
]
|
]
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RegexMapping struct {
|
type RegexMapping struct {
|
||||||
@ -24,13 +25,13 @@ var regexMap = []RegexMapping{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Reddit
|
// Reddit
|
||||||
Pattern: regexp.MustCompile(`reddit\.com|libreddit|redlib`),
|
Pattern: regexp.MustCompile(`reddit\.com|libreddit|redlib|teddit`),
|
||||||
Targets: []string{"libreddit", "redlib"},
|
Targets: []string{"libreddit", "redlib", "teddit"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Google Search
|
// Google Search
|
||||||
Pattern: regexp.MustCompile(`google\.com|whoogle|searx|searxng`),
|
Pattern: regexp.MustCompile(`google\.com|whoogle|searx|searxng`),
|
||||||
Targets: []string{"whoogle", "searx", "searxng"},
|
Targets: []string{"whoogle", "searxng"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Instagram
|
// Instagram
|
||||||
@ -59,8 +60,8 @@ var regexMap = []RegexMapping{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
// Google Translate
|
// Google Translate
|
||||||
Pattern: regexp.MustCompile(`translate\.google\.com|lingva`),
|
Pattern: regexp.MustCompile(`translate\.google\.com|lingva|simplytranslate`),
|
||||||
Targets: []string{"lingva"},
|
Targets: []string{"lingva", "simplytranslate"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// TikTok
|
// TikTok
|
||||||
@ -92,15 +93,47 @@ var regexMap = []RegexMapping{
|
|||||||
Pattern: regexp.MustCompile(`stackoverflow\.com|anonymousoverflow`),
|
Pattern: regexp.MustCompile(`stackoverflow\.com|anonymousoverflow`),
|
||||||
Targets: []string{"anonymousoverflow"},
|
Targets: []string{"anonymousoverflow"},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// Genius
|
||||||
|
Pattern: regexp.MustCompile(`genius\.com|dumb`),
|
||||||
|
Targets: []string{"dumb"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// 4get
|
||||||
|
// Note: Could be used for redirecting other search engine
|
||||||
|
// requests, but would need special handling
|
||||||
|
Pattern: regexp.MustCompile("4get"),
|
||||||
|
Targets: []string{"4get"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// LibreY
|
||||||
|
// Note: Could be used for redirecting other search engine
|
||||||
|
// requests, but would need special handling
|
||||||
|
Pattern: regexp.MustCompile("librex|librey"),
|
||||||
|
Targets: []string{"librey"},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Tent
|
||||||
|
// Note: This is a Bandcamp alternative, but the endpoints are
|
||||||
|
// completely different than Bandcamp, so 1-to-1 mapping of URLs
|
||||||
|
// is not possible without some additional work
|
||||||
|
Pattern: regexp.MustCompile("tent"),
|
||||||
|
Targets: []string{"tent"},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func MatchRequest(service string) (string, error) {
|
func MatchRequest(service string) (string, error) {
|
||||||
|
|
||||||
for _, mapping := range regexMap {
|
for _, mapping := range regexMap {
|
||||||
hasMatch := mapping.Pattern.MatchString(service)
|
hasMatch := mapping.Pattern.MatchString(service)
|
||||||
if !hasMatch {
|
if !hasMatch {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !strings.Contains(service, ".") {
|
||||||
|
return service, nil
|
||||||
|
}
|
||||||
|
|
||||||
index := rand.Intn(len(mapping.Targets))
|
index := rand.Intn(len(mapping.Targets))
|
||||||
value := mapping.Targets[index]
|
value := mapping.Targets[index]
|
||||||
return value, nil
|
return value, nil
|
||||||
|
@ -47,7 +47,6 @@ func GetServicesFileName() string {
|
|||||||
return serviceJSON
|
return serviceJSON
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func FetchServicesFile(serviceJSON string) ([]byte, error) {
|
func FetchServicesFile(serviceJSON string) ([]byte, error) {
|
||||||
resp, err := http.Get(baseRepoLink + serviceJSON)
|
resp, err := http.Get(baseRepoLink + serviceJSON)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user