diff --git a/extractor/structs/parsed.go b/extractor/structs/parsed.go index 3339855..165da1c 100644 --- a/extractor/structs/parsed.go +++ b/extractor/structs/parsed.go @@ -99,6 +99,7 @@ type MinifiedStreamer struct { } type Video struct { + Type string `json:"type"` Preview string `json:"preview"` Game MinifiedCategory `json:"game"` Duration int `json:"duration"` diff --git a/extractor/twitch/parser.go b/extractor/twitch/parser.go index 0193fb2..6110d49 100644 --- a/extractor/twitch/parser.go +++ b/extractor/twitch/parser.go @@ -244,6 +244,7 @@ func ParseMinifiedStreamer(data gjson.Result) structs.MinifiedStreamer { func ParseVideo(data gjson.Result, streamer structs.Streamer) structs.Video { return structs.Video{ + Type: "vod", Preview: extractor.ProxyUrl(data.Get("previewThumbnailURL").String()), Game: ParseMinifiedCategory(data.Get("game")), Duration: int(data.Get("lengthSeconds").Int()), @@ -257,6 +258,7 @@ func ParseVideo(data gjson.Result, streamer structs.Streamer) structs.Video { func ParseClip(data gjson.Result, streamer structs.Streamer) structs.Video { return structs.Video{ + Type: "clip", Preview: extractor.ProxyUrl(data.Get("thumbnailURL").String()), Game: ParseMinifiedCategory(data.Get("clipGame")), Duration: int(data.Get("lengthSeconds").Int()),