crawler

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const DODIName string = "DODI-torrents"
View Source
const KaOsKrewName string = "KaOsKrew-torrents"

Variables

View Source
var TwitchToken string

Functions

func ARMGDDNFormatter

func ARMGDDNFormatter(name string) string

func AddGameInfoManually

func AddGameInfoManually(gameID primitive.ObjectID, platform string, plateformID int) (*model.GameInfo, error)

func BuildCrawlerMap

func BuildCrawlerMap(logger *zap.Logger) map[string]Crawler

func ChovkaFormatter

func ChovkaFormatter(name string) string

func DODIFormatter

func DODIFormatter(name string) string

func FormatName

func FormatName(name string) string

func FreeGOGFormatter

func FreeGOGFormatter(name string) string

func GenerateGameInfo

func GenerateGameInfo(platform string, id int) (*model.GameInfo, error)

func GenerateIGDBGameInfo

func GenerateIGDBGameInfo(id int) (*model.GameInfo, error)

func GenerateSteamGameInfo

func GenerateSteamGameInfo(id int) (*model.GameInfo, error)

func GetIGDBAppDetail

func GetIGDBAppDetail(id int) (*model.IGDBGameDetail, error)

func GetIGDBAppDetailCache

func GetIGDBAppDetailCache(id int) (*model.IGDBGameDetail, error)

func GetIGDBCompany

func GetIGDBCompany(id int) (string, error)

func GetIGDBCompanyCache

func GetIGDBCompanyCache(id int) (string, error)

func GetIGDBID

func GetIGDBID(name string) (int, error)

func GetIGDBIDBySteamID

func GetIGDBIDBySteamID(id int) (int, error)

func GetIGDBIDBySteamIDCache

func GetIGDBIDBySteamIDCache(id int) (int, error)

func GetIGDBIDCache

func GetIGDBIDCache(name string) (int, error)

func GetIGDBIDsBySteamIDs

func GetIGDBIDsBySteamIDs(ids []int) (map[int]int, error)

func GetIGDBIDsBySteamIDsCache

func GetIGDBIDsBySteamIDsCache(ids []int) (map[int]int, error)

func GetSteam250

func GetSteam250(url string) ([]*model.GameInfo, error)

func GetSteam250BestOfTheYear

func GetSteam250BestOfTheYear() ([]*model.GameInfo, error)

func GetSteam250BestOfTheYearCache

func GetSteam250BestOfTheYearCache() ([]*model.GameInfo, error)

func GetSteam250Cache

func GetSteam250Cache(k string, f func() ([]*model.GameInfo, error)) ([]*model.GameInfo, error)

func GetSteam250MostPlayed

func GetSteam250MostPlayed() ([]*model.GameInfo, error)

func GetSteam250MostPlayedCache

func GetSteam250MostPlayedCache() ([]*model.GameInfo, error)

func GetSteam250Top250

func GetSteam250Top250() ([]*model.GameInfo, error)

func GetSteam250Top250Cache

func GetSteam250Top250Cache() ([]*model.GameInfo, error)

func GetSteam250WeekTop50

func GetSteam250WeekTop50() ([]*model.GameInfo, error)

func GetSteam250WeekTop50Cache

func GetSteam250WeekTop50Cache() ([]*model.GameInfo, error)

func GetSteamAppDetail

func GetSteamAppDetail(id int) (*model.SteamAppDetail, error)

func GetSteamAppDetailCache

func GetSteamAppDetailCache(id int) (*model.SteamAppDetail, error)

func GetSteamID

func GetSteamID(name string) (int, error)

func GetSteamIDByIGDBID

func GetSteamIDByIGDBID(IGDBID int) (int, error)

func GetSteamIDByIGDBIDCache

func GetSteamIDByIGDBIDCache(IGDBID int) (int, error)

func GetSteamIDCache

func GetSteamIDCache(name string) (int, error)

func GnarlyFormatter

func GnarlyFormatter(name string) string

func KaOsKrewFormatter

func KaOsKrewFormatter(name string) string

func LoginTwitch

func LoginTwitch() (string, error)

func New1337xCrawler

func New1337xCrawler(source string, formatter Formatter, logger *zap.Logger) *s1337xCrawler

func OnlineFixFormatter

func OnlineFixFormatter(name string) string

func OrganizeGameItem

func OrganizeGameItem(game *model.GameItem) (*model.GameInfo, error)

func OrganizeGameItemManually

func OrganizeGameItemManually(gameID primitive.ObjectID, platform string, platformID int) (*model.GameInfo, error)

func OrganizeGameItemWithIGDB

func OrganizeGameItemWithIGDB(id int, game *model.GameItem) (*model.GameInfo, error)

id=0, means search id by name

func OrganizeGameItemWithSteam

func OrganizeGameItemWithSteam(id int, game *model.GameItem) (*model.GameInfo, error)

func SteamRIPFormatter

func SteamRIPFormatter(name string) string

func SupplementPlatformIDToGameInfo

func SupplementPlatformIDToGameInfo(logger *zap.Logger) error

func XatabFormatter

func XatabFormatter(name string) string

Types

type ARMGDDNCrawler

type ARMGDDNCrawler struct {
	// contains filtered or unexported fields
}

func NewARMGDDNCrawler deprecated

func NewARMGDDNCrawler(logger *zap.Logger) *ARMGDDNCrawler

Deprecated: ARMGDDN has changed resource distribution method

func (*ARMGDDNCrawler) Crawl

func (c *ARMGDDNCrawler) Crawl(num int) ([]*model.GameItem, error)

func (*ARMGDDNCrawler) CrawlAll

func (c *ARMGDDNCrawler) CrawlAll() ([]*model.GameItem, error)

func (*ARMGDDNCrawler) CrawlPC

func (c *ARMGDDNCrawler) CrawlPC(num int) ([]*model.GameItem, error)

func (*ARMGDDNCrawler) CrawlPCVR

func (c *ARMGDDNCrawler) CrawlPCVR(num int) ([]*model.GameItem, error)

type ChovkaCrawler

type ChovkaCrawler struct {
	// contains filtered or unexported fields
}

func NewChovkaCrawler

func NewChovkaCrawler(logger *zap.Logger) *ChovkaCrawler

func (*ChovkaCrawler) Crawl

func (c *ChovkaCrawler) Crawl(page int) ([]*model.GameItem, error)

func (*ChovkaCrawler) CrawlAll

func (c *ChovkaCrawler) CrawlAll() ([]*model.GameItem, error)

func (*ChovkaCrawler) CrawlByUrl

func (c *ChovkaCrawler) CrawlByUrl(url string) (*model.GameItem, error)

func (*ChovkaCrawler) CrawlMulti

func (c *ChovkaCrawler) CrawlMulti(pages []int) ([]*model.GameItem, error)

func (*ChovkaCrawler) GetTotalPageNum

func (c *ChovkaCrawler) GetTotalPageNum() (int, error)

func (*ChovkaCrawler) Name

func (c *ChovkaCrawler) Name() string

type Crawler

type Crawler interface {
	Name() string
	Crawl(int) ([]*model.GameItem, error)
	CrawlAll() ([]*model.GameItem, error)
}

type DODICrawler

type DODICrawler struct {
	// contains filtered or unexported fields
}

func NewDODICrawler

func NewDODICrawler(logger *zap.Logger) *DODICrawler

func (*DODICrawler) Crawl

func (c *DODICrawler) Crawl(page int) ([]*model.GameItem, error)

func (*DODICrawler) CrawlAll

func (c *DODICrawler) CrawlAll() ([]*model.GameItem, error)

func (*DODICrawler) CrawlByUrl

func (c *DODICrawler) CrawlByUrl(url string) (*model.GameItem, error)

func (*DODICrawler) CrawlMulti

func (c *DODICrawler) CrawlMulti(pages []int) ([]*model.GameItem, error)

func (*DODICrawler) GetTotalPageNum

func (c *DODICrawler) GetTotalPageNum() (int, error)

func (*DODICrawler) Name

func (c *DODICrawler) Name() string

type FitGirlCrawler

type FitGirlCrawler struct {
	// contains filtered or unexported fields
}

func NewFitGirlCrawler

func NewFitGirlCrawler(logger *zap.Logger) *FitGirlCrawler

func (*FitGirlCrawler) Crawl

func (c *FitGirlCrawler) Crawl(page int) ([]*model.GameItem, error)

func (*FitGirlCrawler) CrawlAll

func (c *FitGirlCrawler) CrawlAll() ([]*model.GameItem, error)

func (*FitGirlCrawler) CrawlByUrl

func (c *FitGirlCrawler) CrawlByUrl(url string) (*model.GameItem, error)

func (*FitGirlCrawler) CrawlMulti

func (c *FitGirlCrawler) CrawlMulti(pages []int) ([]*model.GameItem, error)

func (*FitGirlCrawler) GetTotalPageNum

func (c *FitGirlCrawler) GetTotalPageNum() (int, error)

func (*FitGirlCrawler) Name

func (c *FitGirlCrawler) Name() string

type Formatter

type Formatter func(string) string

type FreeGOGCrawler

type FreeGOGCrawler struct {
	// contains filtered or unexported fields
}

func NewFreeGOGCrawler deprecated

func NewFreeGOGCrawler(logger *zap.Logger) *FreeGOGCrawler

Deprecated: Unable to get through cloudflare

func (*FreeGOGCrawler) Crawl

func (c *FreeGOGCrawler) Crawl(num int) ([]*model.GameItem, error)

func (*FreeGOGCrawler) CrawlAll

func (c *FreeGOGCrawler) CrawlAll() ([]*model.GameItem, error)

func (*FreeGOGCrawler) CrawlByUrl

func (c *FreeGOGCrawler) CrawlByUrl(url string) (*model.GameItem, error)

type GOGGamesCrawler

type GOGGamesCrawler struct {
	// contains filtered or unexported fields
}

func NewGOGGamesCrawler

func NewGOGGamesCrawler(logger *zap.Logger) *GOGGamesCrawler

func (*GOGGamesCrawler) Crawl

func (c *GOGGamesCrawler) Crawl(page int) ([]*model.GameItem, error)

func (*GOGGamesCrawler) CrawlAll

func (c *GOGGamesCrawler) CrawlAll() ([]*model.GameItem, error)

func (*GOGGamesCrawler) CrawlByUrl

func (c *GOGGamesCrawler) CrawlByUrl(url string) (*model.GameItem, error)

func (*GOGGamesCrawler) CrawlMulti

func (c *GOGGamesCrawler) CrawlMulti(pages []int) ([]*model.GameItem, error)

func (*GOGGamesCrawler) GetTotalPageNum

func (c *GOGGamesCrawler) GetTotalPageNum() (int, error)

func (*GOGGamesCrawler) Name

func (c *GOGGamesCrawler) Name() string

type GameData

type GameData struct {
	NumberOfGame string `json:"Number of game"`
	AppID        string `json:"appid"`
	FolderName   string `json:"foldername"`
}

type GnarlyCrawler

type GnarlyCrawler struct {
	// contains filtered or unexported fields
}

func NewGnarlyCrawler

func NewGnarlyCrawler(logger *zap.Logger) *GnarlyCrawler

func (*GnarlyCrawler) Crawl

func (c *GnarlyCrawler) Crawl(num int) ([]*model.GameItem, error)

func (*GnarlyCrawler) CrawlAll

func (c *GnarlyCrawler) CrawlAll() ([]*model.GameItem, error)

type KaOsKrewCrawler

type KaOsKrewCrawler struct {
	// contains filtered or unexported fields
}

func NewKaOsKrewCrawler

func NewKaOsKrewCrawler(logger *zap.Logger) *KaOsKrewCrawler

func (*KaOsKrewCrawler) Crawl

func (c *KaOsKrewCrawler) Crawl(page int) ([]*model.GameItem, error)

func (*KaOsKrewCrawler) CrawlAll

func (c *KaOsKrewCrawler) CrawlAll() ([]*model.GameItem, error)

func (*KaOsKrewCrawler) CrawlByUrl

func (c *KaOsKrewCrawler) CrawlByUrl(url string) (*model.GameItem, error)

func (*KaOsKrewCrawler) CrawlMulti

func (c *KaOsKrewCrawler) CrawlMulti(pages []int) ([]*model.GameItem, error)

func (*KaOsKrewCrawler) GetTotalPageNum

func (c *KaOsKrewCrawler) GetTotalPageNum() (int, error)

func (*KaOsKrewCrawler) Name

func (c *KaOsKrewCrawler) Name() string

type OnlineFixCrawler

type OnlineFixCrawler struct {
	// contains filtered or unexported fields
}

func NewOnlineFixCrawler

func NewOnlineFixCrawler(logger *zap.Logger) *OnlineFixCrawler

func (*OnlineFixCrawler) Crawl

func (c *OnlineFixCrawler) Crawl(page int) ([]*model.GameItem, error)

func (*OnlineFixCrawler) CrawlAll

func (c *OnlineFixCrawler) CrawlAll() ([]*model.GameItem, error)

func (*OnlineFixCrawler) CrawlByUrl

func (c *OnlineFixCrawler) CrawlByUrl(url string) (*model.GameItem, error)

func (*OnlineFixCrawler) CrawlMulti

func (c *OnlineFixCrawler) CrawlMulti(pages []int) ([]*model.GameItem, error)

func (*OnlineFixCrawler) GetTotalPageNum

func (c *OnlineFixCrawler) GetTotalPageNum() (int, error)

func (*OnlineFixCrawler) Name

func (c *OnlineFixCrawler) Name() string

type PagedCrawler

type PagedCrawler interface {
	Crawler
	CrawlMulti([]int) ([]*model.GameItem, error)
	GetTotalPageNum() (int, error)
}

type SimpleCrawler

type SimpleCrawler interface {
	Crawler
}

type SteamRIPCrawler

type SteamRIPCrawler struct {
	// contains filtered or unexported fields
}

func NewSteamRIPCrawler

func NewSteamRIPCrawler(logger *zap.Logger) *SteamRIPCrawler

func (*SteamRIPCrawler) Crawl

func (c *SteamRIPCrawler) Crawl(num int) ([]*model.GameItem, error)

func (*SteamRIPCrawler) CrawlAll

func (c *SteamRIPCrawler) CrawlAll() ([]*model.GameItem, error)

func (*SteamRIPCrawler) CrawlByUrl

func (c *SteamRIPCrawler) CrawlByUrl(url string) (*model.GameItem, error)

func (*SteamRIPCrawler) Name

func (c *SteamRIPCrawler) Name() string

type XatabCrawler

type XatabCrawler struct {
	// contains filtered or unexported fields
}

func NewXatabCrawler

func NewXatabCrawler(logger *zap.Logger) *XatabCrawler

func (*XatabCrawler) Crawl

func (c *XatabCrawler) Crawl(page int) ([]*model.GameItem, error)

func (*XatabCrawler) CrawlAll

func (c *XatabCrawler) CrawlAll() ([]*model.GameItem, error)

func (*XatabCrawler) CrawlByUrl

func (c *XatabCrawler) CrawlByUrl(url string) (*model.GameItem, error)

func (*XatabCrawler) CrawlMulti

func (c *XatabCrawler) CrawlMulti(pages []int) ([]*model.GameItem, error)

func (*XatabCrawler) GetTotalPageNum

func (c *XatabCrawler) GetTotalPageNum() (int, error)

func (*XatabCrawler) Name

func (c *XatabCrawler) Name() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL