files search added (wip)

This commit is contained in:
partisan 2024-05-23 10:56:26 +02:00
parent 585684f15b
commit 31460ee6be
13 changed files with 431 additions and 44 deletions

View file

@ -1,4 +1,3 @@
// main.go
package main
import (
@ -72,6 +71,7 @@ func main() {
http.HandleFunc("/settings", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "templates/settings.html")
})
initializeTorrentSites()
fmt.Println("Server is listening on http://localhost:5000")
log.Fatal(http.ListenAndServe(":5000", nil))
}
@ -88,11 +88,13 @@ func handleSearch(w http.ResponseWriter, r *http.Request) {
case "image":
handleImageSearch(w, query, safe, lang, page)
case "video":
videoSearchEndpointHandler(w, r)
handleVideoSearch(w, query, safe, lang, page)
case "map":
handleMapSearch(w, query, safe)
case "forum":
handleForumsSearch(w, query, safe, lang, page)
case "file":
handleFileSearch(w, query, safe, lang, page)
case "text":
fallthrough
default: