diff --git a/extractor/parser.go b/extractor/parser.go index 590dd52..f27590e 100644 --- a/extractor/parser.go +++ b/extractor/parser.go @@ -13,9 +13,9 @@ func ParseSocials(data string) ([]structs.Social, error) { result := gjson.Get(data, "user.channel.socialMedias") for _, social := range result.Array() { parsedSocials = append(parsedSocials, structs.Social{ - Title: social.Get("title").String(), - Type: social.Get("name").String(), - Url: social.Get("url").String(), + Name: social.Get("title").String(), + Type: social.Get("name").String(), + Url: social.Get("url").String(), }) } @@ -95,7 +95,7 @@ func ParseMinifiedStream(data gjson.Result) (structs.CategoryMinifiedStream, err parsedStream := structs.CategoryMinifiedStream{ Title: data.Get("node.title").String(), Viewers: int(data.Get("node.viewersCount").Int()), - Preview: ProxyUrl(data.Get("previewImageURL").String()), + Preview: ProxyUrl(data.Get("node.previewImageURL").String()), Tags: tags, Streamer: structs.CategoryMinifiedStreamer{ Name: data.Get("node.broadcaster.login").String(), diff --git a/extractor/structs/parsed.go b/extractor/structs/parsed.go index 6963fa9..cae8757 100644 --- a/extractor/structs/parsed.go +++ b/extractor/structs/parsed.go @@ -3,9 +3,9 @@ package structs import "time" type Social struct { - Type string `json:"type"` - Title string `json:"title"` - Url string `json:"url"` + Type string `json:"type"` + Name string `json:"name"` + Url string `json:"url"` } type Stream struct { diff --git a/extractor/utils.go b/extractor/utils.go index cee169d..1297270 100644 --- a/extractor/utils.go +++ b/extractor/utils.go @@ -14,7 +14,7 @@ func ProxyUrl(url string) string { type ServerFormat struct { Status string `json:"status"` - Message interface{} `json:"message"` + Message interface{} `json:"data"` } func FormatMessage(data interface{}, ok bool) ServerFormat {