Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Media ¶
type Media struct {
Source MediaSource `json:"source"`
RequestUrl string `json:"request_url"`
Id string `json:"id"`
Shortcode string `json:"shortcode"`
Title string `json:"title"`
Author string `json:"author"`
Type string `json:"type"`
Comments uint64 `json:"comments_count"`
Likes uint64 `json:"likes_count"`
Caption string `json:"caption"`
Url string `json:"url"`
Items []*MediaItem `json:"items"`
TakenAt int64 `json:"taken_at"` // Timestamp
}
Media which contains a single Instagram post
func FromEmbedResponse ¶
func FromEmbedResponse(embed response.EmbedResponse) Media
FromEmbedResponse will automatically transforms the EmbedResponse to the Media
type MediaItem ¶
type MediaItem struct {
Id string `json:"id"`
Shortcode string `json:"shortcode"`
Type MediaType `json:"type"`
VideoWithoutAudio bool `json:"video_without_audio"`
Url string `json:"url"`
Quality string `json:"quality"`
ContentLength int64 `json:"content_length"`
MimeType string `json:"mime_type"`
Width int `json:"width"`
Height int `json:"height"`
// Duration is the media length in whole seconds, 0 when unknown. Telegram
// never probes an uploaded file, so a video sent without it shows up with no
// length in the client until the user downloads the whole thing.
Duration int `json:"duration,omitempty"`
// ThumbnailUrl is a publicly fetchable JPEG cover frame, empty when unknown.
// Telegram inline video results carry a mandatory thumbnail_url that must be
// a JPEG — the media URL itself is not a valid value for it.
ThumbnailUrl string `json:"thumbnail_url,omitempty"`
// DownloadHeaders are extra HTTP headers required to download Url (e.g.
// TikTok CDN needs Referer + Cookie). Empty for sources whose URLs are
// publicly fetchable. Downloading is handled by internal/media.Loader.
DownloadHeaders map[string]string `json:"-"`
}
MediaItem contains information about the Instagram post which is similar to the Instagram Media struct
type MediaSource ¶
type MediaSource string
const ( MediaSourceInstagram MediaSource = "instagram" MediaSourceYoutube MediaSource = "youtube" MediaSourceTikTok MediaSource = "tiktok" MediaSourceTwitter MediaSource = "twitter" MediaSourceFacebook MediaSource = "facebook" MediaSourceVimeo MediaSource = "vimeo" MediaSourceReddit MediaSource = "reddit" MediaSourcePinterest MediaSource = "pinterest" MediaSourceTumblr MediaSource = "tumblr" MediaSourceBilibili MediaSource = "bilibili" MediaSourceDouyin MediaSource = "douyin" MediaSourceWeibo MediaSource = "weibo" MediaSourceXiaohongshu MediaSource = "xiaohongshu" MediaSourceVK MediaSource = "vk" MediaSourceRumble MediaSource = "rumble" MediaSourceIqiyi MediaSource = "iqiyi" MediaSourceYouku MediaSource = "youku" MediaSourceKuaishou MediaSource = "kuaishou" MediaSourceXigua MediaSource = "ixigua" MediaSourceDouyu MediaSource = "douyu" MediaSourceHuya MediaSource = "huya" MediaSourceMgtv MediaSource = "mgtv" MediaSourceQQ MediaSource = "qq" MediaSourceNetease MediaSource = "netease" MediaSourceZhihu MediaSource = "zhihu" MediaSourceAcfun MediaSource = "acfun" MediaSourceBcy MediaSource = "bcy" MediaSourceEporner MediaSource = "eporner" MediaSourceGeekbang MediaSource = "geekbang" MediaSourceHaokan MediaSource = "haokan" MediaSourceHupu MediaSource = "hupu" MediaSourceMiaopai MediaSource = "miaopai" MediaSourcePixivision MediaSource = "pixivision" MediaSourcePornhub MediaSource = "pornhub" MediaSourceStreamtape MediaSource = "streamtape" MediaSourceTangdou MediaSource = "tangdou" MediaSourceUdn MediaSource = "udn" MediaSourceXimalaya MediaSource = "ximalaya" MediaSourceXinpianchang MediaSource = "xinpianchang" MediaSourceXvideos MediaSource = "xvideos" MediaSourceYinyuetai MediaSource = "yinyuetai" MediaSourceZingmp3 MediaSource = "zingmp3" )
Common media sources
func (MediaSource) String ¶ added in v0.4.0
func (s MediaSource) String() string
type Owner ¶
type Owner struct {
Id string `json:"id"`
ProfilePictureURL string `json:"profile_pic_url"`
Username string `json:"username"`
Followers uint64 `json:"followers_count"`
IsPrivate bool `json:"is_private"`
IsVerified bool `json:"is_verified"`
}
Owner is a single Instagram user who owns the Media
Click to show internal directories.
Click to hide internal directories.