auto append sufix to Config.CFClearanceScraper.Url
This commit is contained in:
parent
b138550d9b
commit
08a4aafaf9
@ -100,6 +100,10 @@ func init() {
|
||||
Config.OnlineFixAvaliable = Config.OnlineFix.User != "" && Config.OnlineFix.Password != ""
|
||||
Config.RedisAvaliable = Config.Redis.Host != ""
|
||||
Config.DatabaseAvaliable = Config.Database.Database != "" && Config.Database.Host != ""
|
||||
|
||||
if Config.CFClearanceScraper.Url != "" && !strings.HasSuffix(Config.CFClearanceScraper.Url, "/cf-clearance-scraper") {
|
||||
Config.CFClearanceScraper.Url += "/cf-clearance-scraper"
|
||||
}
|
||||
}
|
||||
|
||||
func loadEnvVariables(cfg interface{}) {
|
||||
|
@ -96,10 +96,6 @@ func (c *FreeGOGCrawler) Crawl(num int) ([]*model.GameItem, error) {
|
||||
}
|
||||
|
||||
func (c *FreeGOGCrawler) CrawlByUrl(url string, session *utils.WAFSession) (*model.GameItem, error) {
|
||||
var err error
|
||||
if err != nil {
|
||||
return nil, errors.New("Failed to create session")
|
||||
}
|
||||
resp, err := utils.FetchWithWAFSession(utils.FetchConfig{
|
||||
Url: url,
|
||||
}, session)
|
||||
|
Loading…
Reference in New Issue
Block a user