Add missing handling for 4get and LibreY, remove LibreX

This commit is contained in:
Ben Busby 2025-02-25 15:38:33 -07:00
parent 4b19ad5228
commit f3ab726cec
No known key found for this signature in database
GPG Key ID: B9B7231E01D924A1
5 changed files with 16 additions and 53 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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",

View File

@ -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",

View File

@ -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) {