0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch-backend.git synced 2024-12-21 20:53:00 -05:00
This commit is contained in:
dragongoose 2023-07-20 14:13:41 -04:00
parent a9fe2eaaf3
commit 91aba7de42
No known key found for this signature in database
GPG key ID: 01397EEC371CDAA5
2 changed files with 3 additions and 0 deletions

View file

@ -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"`

View file

@ -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()),