fix gog and epic scraper
This commit is contained in:
parent
168d67fd0c
commit
29e06127ee
3 changed files with 5 additions and 4 deletions
|
@ -126,7 +126,7 @@ func (e EpicStruct) Load() error {
|
||||||
|
|
||||||
image := ""
|
image := ""
|
||||||
for _, keyImage := range element.KeyImages {
|
for _, keyImage := range element.KeyImages {
|
||||||
if keyImage.Type == "DieselStoreFrontWide" {
|
if keyImage.Type == "OfferImageWide" {
|
||||||
image = keyImage.Url
|
image = keyImage.Url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,11 +70,11 @@ func (e GogFrontStruct) Load() error {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, a := range t.Attr {
|
for _, a := range t.Attr {
|
||||||
if !(a.Key == "id" && a.Val == "giveaway") {
|
if !(a.Key == "class" && a.Val == "giveaway__overlay-link") {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, attr := range t.Attr {
|
for _, attr := range t.Attr {
|
||||||
if attr.Key != "ng-href" {
|
if attr.Key != "href" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
appID := regexAppid.FindStringSubmatch(attr.Val)
|
appID := regexAppid.FindStringSubmatch(attr.Val)
|
||||||
|
|
|
@ -64,7 +64,8 @@ func main() {
|
||||||
api.NewSteamApi(logger),
|
api.NewSteamApi(logger),
|
||||||
api.NewGogFrontApi(logger),
|
api.NewGogFrontApi(logger),
|
||||||
api.NewGogApi(logger),
|
api.NewGogApi(logger),
|
||||||
api.NewHumbleBundleApi(logger))
|
api.NewHumbleBundleApi(logger),
|
||||||
|
)
|
||||||
for _, a := range apis {
|
for _, a := range apis {
|
||||||
err := a.Load()
|
err := a.Load()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue