pcgamedb/crawler/crawler.go
nite07 f8e3265a76 fix CleanOrphanGamesInGameInfos
mod SearchGameInfo
fix trigger body miss data
disable goggames crawler
2024-11-18 20:21:08 +08:00

40 lines
928 B
Go

package crawler
import (
"github.com/nitezs/pcgamedb/model"
"go.uber.org/zap"
)
type Crawler interface {
Name() string
Crawl(int) ([]*model.GameItem, error)
CrawlAll() ([]*model.GameItem, error)
}
type SimpleCrawler interface {
Crawler
}
type PagedCrawler interface {
Crawler
CrawlMulti([]int) ([]*model.GameItem, error)
GetTotalPageNum() (int, error)
}
func BuildCrawlerMap(logger *zap.Logger) map[string]Crawler {
return map[string]Crawler{
"fitgirl": NewFitGirlCrawler(logger),
"dodi": NewDODICrawler(logger),
"kaoskrew": NewKaOsKrewCrawler(logger),
// "freegog": NewFreeGOGCrawler(logger),
"xatab": NewXatabCrawler(logger),
"onlinefix": NewOnlineFixCrawler(logger),
"steamrip": NewSteamRIPCrawler(logger),
// "armgddn": NewARMGDDNCrawler(logger),
// "goggames": NewGOGGamesCrawler(logger),
"chovka": NewChovkaCrawler(logger),
// "gnarly": NewGnarlyCrawler(logger),
}
}