diff --git a/types.go b/types.go index be34a0d..35fccd5 100644 --- a/types.go +++ b/types.go @@ -21,6 +21,7 @@ type ( ID string Preview string URL string + HLSURL string } // GIF type. @@ -127,6 +128,7 @@ type ( URL string `json:"url"` VideoInfo struct { Variants []struct { + Type string `json:"content_type"` Bitrate int `json:"bitrate"` URL string `json:"url"` } `json:"variants"` diff --git a/util.go b/util.go index bec2573..0a2f658 100644 --- a/util.go +++ b/util.go @@ -248,6 +248,9 @@ func parseLegacyTweet(user *legacyUser, tweet *legacyTweet) *Tweet { maxBitrate := 0 for _, variant := range media.VideoInfo.Variants { + if variant.Type == "application/x-mpegURL" { + video.HLSURL = variant.URL + } if variant.Bitrate > maxBitrate { video.URL = strings.TrimSuffix(variant.URL, "?tag=10") maxBitrate = variant.Bitrate