316ae2f9db
Add 8 all/ sources (7 Masonry, 1 Madara) and 38 en/ sources spanning Madara, MangaThemesia, MadTheme, Keyoapp, and Guya bases, plus 8 earlier all/ standalone sources from the previous session (ahottie, akuma, allporncomicsco, asmhentai, baobua, beauty3600000, buondua, comicfury, comicgrowl, comicklive, comicsvalley, comikey, commitstrip, coomer). Also annotates phase4-standalone.md with base-class tags for 43 additional unimplemented en/ sources identified in a full scan.
146 lines
4.1 KiB
Go
Executable File
146 lines
4.1 KiB
Go
Executable File
package main
|
|
|
|
import (
|
|
"context"
|
|
"encoding/json"
|
|
"fmt"
|
|
"log"
|
|
"net/http"
|
|
|
|
"goyomi/internal/config"
|
|
"goyomi/internal/db"
|
|
_ "goyomi/internal/registry"
|
|
_ "goyomi/sources/all/ahottie"
|
|
_ "goyomi/sources/all/akuma"
|
|
_ "goyomi/sources/all/allporncomicsco"
|
|
_ "goyomi/sources/all/asmhentai"
|
|
_ "goyomi/sources/all/baobua"
|
|
_ "goyomi/sources/all/beauty3600000"
|
|
_ "goyomi/sources/all/buondua"
|
|
_ "goyomi/sources/all/comicfury"
|
|
_ "goyomi/sources/all/comicgrowl"
|
|
_ "goyomi/sources/all/comicklive"
|
|
_ "goyomi/sources/all/comikey"
|
|
_ "goyomi/sources/all/comicsvalley"
|
|
_ "goyomi/sources/all/commitstrip"
|
|
_ "goyomi/sources/all/coomer"
|
|
_ "goyomi/sources/all/elitebabes"
|
|
_ "goyomi/sources/all/femjoyhunter"
|
|
_ "goyomi/sources/all/ftvhunter"
|
|
_ "goyomi/sources/all/joymiihub"
|
|
_ "goyomi/sources/all/mangacrazy"
|
|
_ "goyomi/sources/all/metarthunter"
|
|
_ "goyomi/sources/all/playmatehunter"
|
|
_ "goyomi/sources/all/xarthunter"
|
|
_ "goyomi/sources/all/hentaihand"
|
|
_ "goyomi/sources/all/kemono"
|
|
_ "goyomi/sources/all/mangataro"
|
|
_ "goyomi/sources/en/bakkin"
|
|
_ "goyomi/sources/en/divascans"
|
|
_ "goyomi/sources/en/guya"
|
|
_ "goyomi/sources/en/hijalascans"
|
|
_ "goyomi/sources/en/kaizenscan"
|
|
_ "goyomi/sources/en/kewnscans"
|
|
_ "goyomi/sources/en/lunatoons"
|
|
_ "goyomi/sources/en/mistscans"
|
|
_ "goyomi/sources/en/necroscans"
|
|
_ "goyomi/sources/en/nyanukafe"
|
|
_ "goyomi/sources/en/nyxscans"
|
|
_ "goyomi/sources/en/orionscans"
|
|
_ "goyomi/sources/en/renascans"
|
|
_ "goyomi/sources/en/sanascans"
|
|
_ "goyomi/sources/en/sirenscans"
|
|
_ "goyomi/sources/en/vanillascans"
|
|
_ "goyomi/sources/en/aquamanga"
|
|
_ "goyomi/sources/en/arenascans"
|
|
_ "goyomi/sources/en/artlapsa"
|
|
_ "goyomi/sources/en/cocomic"
|
|
_ "goyomi/sources/en/comicsland"
|
|
_ "goyomi/sources/en/crowscans"
|
|
_ "goyomi/sources/en/dankefurslesen"
|
|
_ "goyomi/sources/en/elftoon"
|
|
_ "goyomi/sources/en/gakamangas"
|
|
_ "goyomi/sources/en/galaxydegenscans"
|
|
_ "goyomi/sources/en/hachirumi"
|
|
_ "goyomi/sources/en/hentai4free"
|
|
_ "goyomi/sources/en/jinmangas"
|
|
_ "goyomi/sources/en/kaliscanme"
|
|
_ "goyomi/sources/en/kingofshojo"
|
|
_ "goyomi/sources/en/kissmangain"
|
|
_ "goyomi/sources/en/kunmanga"
|
|
_ "goyomi/sources/en/lhtranslation"
|
|
_ "goyomi/sources/en/manga18x"
|
|
_ "goyomi/sources/en/mangagg"
|
|
_ "goyomi/sources/en/mangahe"
|
|
_ "goyomi/sources/en/mangahentai"
|
|
_ "goyomi/sources/en/manhwalover"
|
|
_ "goyomi/sources/en/manhwareads"
|
|
_ "goyomi/sources/en/manhwatop"
|
|
_ "goyomi/sources/en/manhwax"
|
|
_ "goyomi/sources/en/mgjinx"
|
|
_ "goyomi/sources/en/octopusmanga"
|
|
_ "goyomi/sources/en/pawmanga"
|
|
_ "goyomi/sources/en/ravenscans"
|
|
_ "goyomi/sources/en/ritharscans"
|
|
_ "goyomi/sources/en/rosesquadscans"
|
|
_ "goyomi/sources/en/ryumanga"
|
|
_ "goyomi/sources/en/tcbscansunoriginal"
|
|
_ "goyomi/sources/en/toonilyme"
|
|
_ "goyomi/sources/en/toonitube"
|
|
_ "goyomi/sources/en/topmanhua"
|
|
_ "goyomi/sources/en/yaoihub"
|
|
)
|
|
|
|
func main() {
|
|
cfg := config.Load()
|
|
|
|
ctx := context.Background()
|
|
database, err := db.Open(ctx)
|
|
if err != nil {
|
|
log.Fatalf("db: %v", err)
|
|
}
|
|
defer database.Close()
|
|
|
|
// Initialize config manager
|
|
config.InitConfigManager(database.Queries)
|
|
|
|
mux := http.NewServeMux()
|
|
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
|
|
fmt.Fprintln(w, "ok")
|
|
})
|
|
|
|
// Config endpoints
|
|
mux.HandleFunc("/api/config/flaresolverr", handleFlareSolverrConfig)
|
|
|
|
log.Printf("listening on %s", cfg.Addr)
|
|
if err := http.ListenAndServe(cfg.Addr, mux); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
}
|
|
|
|
func handleFlareSolverrConfig(w http.ResponseWriter, r *http.Request) {
|
|
ctx := r.Context()
|
|
|
|
switch r.Method {
|
|
case "GET":
|
|
enabled := config.IsFlareSolverrProxyEnabled()
|
|
json.NewEncoder(w).Encode(map[string]bool{"flaresolverr_proxy": enabled})
|
|
|
|
case "POST":
|
|
var req struct {
|
|
Enabled bool `json:"enabled"`
|
|
}
|
|
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
|
http.Error(w, "invalid request", http.StatusBadRequest)
|
|
return
|
|
}
|
|
if err := config.SetFlareSolverrProxyEnabled(ctx, req.Enabled); err != nil {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
return
|
|
}
|
|
json.NewEncoder(w).Encode(map[string]bool{"flaresolverr_proxy": req.Enabled})
|
|
|
|
default:
|
|
http.Error(w, "method not allowed", http.StatusMethodNotAllowed)
|
|
}
|
|
} |