diff --git a/.github/workflows/update-instances.yml b/.github/workflows/update-instances.yml index f52d73d..d099f37 100644 --- a/.github/workflows/update-instances.yml +++ b/.github/workflows/update-instances.yml @@ -251,12 +251,6 @@ jobs: .clearnet] | 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 \ '( .[] | select(.type == "librey") ) .instances |= $librey[0]' services-full.json > services-tmp.json diff --git a/server/server.go b/server/server.go index b4ebb80..b066a5f 100644 --- a/server/server.go +++ b/server/server.go @@ -86,8 +86,9 @@ func routing(w http.ResponseWriter, r *http.Request, jsEnabled bool, query strin target, err := services.MatchRequest(segments[0]) if err != nil { + errMsg := fmt.Sprintf("No routing found for '%s'", segments[0]) 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 } diff --git a/services-full.json b/services-full.json index 87e3043..489ffcd 100644 --- a/services-full.json +++ b/services-full.json @@ -396,29 +396,6 @@ "https://cringe.whateveritworks.org" ] }, - { - "type": "librex", - "test_url": "/search.php?q=<%=query%>", - "fallback": "https://librex.myroware.eu", - "instances": [ - "https://libre.blitzw.in", - "https://librex.nohost.network", - "https://librey.4o1x5.dev", - "https://librey.baczek.me", - "https://librey.darkness.services", - "https://librey.nube-gran.de", - "https://librey.org", - "https://librey.sny.sh", - "https://ly.owo.si", - "https://search.davidovski.xyz", - "https://search.funami.tech", - "https://search.liv.town", - "https://search.revvy.de", - "https://search.technicalvoid.dev", - "https://search.uwabaki.party", - "https://serp.catswords.net" - ] - }, { "type": "quetre", "test_url": "/How-does-the-Z-boson-decay", diff --git a/services.json b/services.json index 279d1eb..648a434 100644 --- a/services.json +++ b/services.json @@ -366,29 +366,6 @@ "https://cringe.whateveritworks.org" ] }, - { - "type": "librex", - "test_url": "/search.php?q=<%=query%>", - "fallback": "https://librex.myroware.eu", - "instances": [ - "https://libre.blitzw.in", - "https://librex.nohost.network", - "https://librey.4o1x5.dev", - "https://librey.baczek.me", - "https://librey.darkness.services", - "https://librey.nube-gran.de", - "https://librey.org", - "https://librey.sny.sh", - "https://ly.owo.si", - "https://search.davidovski.xyz", - "https://search.funami.tech", - "https://search.liv.town", - "https://search.revvy.de", - "https://search.technicalvoid.dev", - "https://search.uwabaki.party", - "https://serp.catswords.net" - ] - }, { "type": "quetre", "test_url": "/How-does-the-Z-boson-decay", diff --git a/services/mappings.go b/services/mappings.go index 0099ecd..8766863 100644 --- a/services/mappings.go +++ b/services/mappings.go @@ -97,6 +97,20 @@ var regexMap = []RegexMapping{ 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"}, + }, } func MatchRequest(service string) (string, error) {