added media data to Post
This commit is contained in:
@@ -553,6 +553,116 @@ type Post struct {
|
||||
IsSelfPost bool `json:"is_self"`
|
||||
Saved bool `json:"saved"`
|
||||
Stickied bool `json:"stickied"`
|
||||
|
||||
Thumbnail string `json:"thumbnail"`
|
||||
|
||||
MediaMetadata *MediaMetadata `json:"media_metadata,omitempty"`
|
||||
GalleryData *GalleryData `json:"gallery_data,omitempty"`
|
||||
|
||||
Preview *Preview `json:"preview,omitempty"`
|
||||
SecureMedia *SecureMedia `json:"secure_media,omitempty"`
|
||||
}
|
||||
|
||||
type SecureMedia struct {
|
||||
RedditVideo RedditVideo `json:"reddit_video"`
|
||||
OEmbed OEmbed `json:"oembed"`
|
||||
}
|
||||
|
||||
type OEmbed struct {
|
||||
ProviderUrl string `json:"provider_url"`
|
||||
Version string `json:"version"`
|
||||
Title string `json:"title"`
|
||||
ThumbnailWidth int `json:"thumbnail_width"`
|
||||
Height int `json:"height"`
|
||||
Width int `json:"width"`
|
||||
Html string `json:"html"`
|
||||
ProviderName string `json:"provider_name"`
|
||||
ThumbnailUrl string `json:"thumbnail_url"`
|
||||
Type string `json:"type"`
|
||||
ThumbnailHeight int `json:"thumbnail_height"`
|
||||
}
|
||||
|
||||
type RedditVideo struct {
|
||||
BitrateKbps int `json:"bitrate_kbps"`
|
||||
DashUrl string `json:"dash_url"`
|
||||
Duration int `json:"duration"`
|
||||
FallbackUrl string `json:"fallback_url"`
|
||||
HasAudio bool `json:"has_audio"`
|
||||
Height int `json:"height"`
|
||||
HlsUrl string `json:"hls_url"`
|
||||
IsGif bool `json:"is_gif"`
|
||||
ScrubberMediaUrl string `json:"scrubber_media_url"`
|
||||
TranscodingStatus string `json:"transcoding_status"`
|
||||
Width int `json:"width"`
|
||||
}
|
||||
|
||||
type Preview struct {
|
||||
Images []Image `json:"images"`
|
||||
Enabled bool `json:"enabled"`
|
||||
RedditVideoPreview *VideoPreview `json:"reddit_video_preview"`
|
||||
}
|
||||
|
||||
type Image struct {
|
||||
Source Resolution `json:"source"`
|
||||
Resolutions []Resolution `json:"resolutions"`
|
||||
Variants Variants `json:"variants"`
|
||||
Id string `json:"id"`
|
||||
}
|
||||
|
||||
type Resolution struct {
|
||||
Url string `json:"url"`
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
}
|
||||
|
||||
type Variants struct {
|
||||
Obfuscated *ImageVariant `json:"obfuscated"`
|
||||
Nsfw *ImageVariant `json:"nsfw"`
|
||||
Mp4 *ImageVariant `json:"mp4"`
|
||||
}
|
||||
|
||||
type ImageVariant struct {
|
||||
Source Resolution `json:"source"`
|
||||
Resolutions []Resolution `json:"resolutions"`
|
||||
}
|
||||
|
||||
type VideoPreview struct {
|
||||
BitrateKbps int `json:"bitrate_kbps"`
|
||||
FallbackUrl string `json:"fallback_url"`
|
||||
Height int `json:"height"`
|
||||
Width int `json:"width"`
|
||||
ScrubberMediaUrl string `json:"scrubber_media_url"`
|
||||
DashUrl string `json:"dash_url"`
|
||||
Duration int `json:"duration"`
|
||||
HlsUrl string `json:"hls_url"`
|
||||
IsGif bool `json:"is_gif"`
|
||||
TranscodingStatus string `json:"transcoding_status"`
|
||||
}
|
||||
|
||||
type GalleryData struct {
|
||||
Items []GalleryItem `json:"items"`
|
||||
}
|
||||
|
||||
type GalleryItem struct {
|
||||
MediaId string `json:"media_id"`
|
||||
Id int `json:"id"`
|
||||
}
|
||||
|
||||
type MediaMetadata map[string]Metadata
|
||||
|
||||
type Metadata struct {
|
||||
Status string `json:"status"`
|
||||
E string `json:"e"`
|
||||
M string `json:"m"`
|
||||
P []Picture `json:"p"`
|
||||
S Picture `json:"s"`
|
||||
Id string `json:"id"`
|
||||
}
|
||||
|
||||
type Picture struct {
|
||||
Y int `json:"y"`
|
||||
X int `json:"x"`
|
||||
U string `json:"u"`
|
||||
}
|
||||
|
||||
// Subreddit holds information about a subreddit
|
||||
|
||||
Reference in New Issue
Block a user