Documentation ¶
Index ¶
- func CreateJsonCookieJar(l core.ILogger, cookieFile string) http.CookieJar
- func CreateTikTokMediaFactory(l core.ILogger, api YoutubeApi) core.IMediaFactory
- type CoreFactory
- type Entity
- type Error
- type GraphQLResponse
- type GraphQLResponseCore
- type GraphQLResponseData
- type GraphQLResponseTweetResult
- type GraphQLResponseTweetResultResult
- type GraphQLResponseUserResult
- type GraphQLResponseUserResults
- type GraphQLVariables
- type HttpClient
- type IgCaption
- type IgReel
- type IgReelClipsMetadata
- type IgReelItem
- type IgReelMusicAssetInfo
- type IgReelMusicInfo
- type IgReelOriginalSoundInfo
- type IgReelVideo
- type IgUser
- type InstAPI
- type InstagramAPI
- type JsonCookieJar
- type Media
- type OpenGraphParser
- type OutlineAPI
- type OutlineAPIKeys
- type Telebot
- type TelebotAdapter
- func (a *TelebotAdapter) Delete(message *core.Message) error
- func (a *TelebotAdapter) Edit(message *core.Message, what interface{}, options ...interface{}) (*core.Message, error)
- func (a *TelebotAdapter) GetCommands(chatID int64) ([]core.Command, error)
- func (a *TelebotAdapter) IsUserMemberOfChat(user *core.User, chatID int64) bool
- func (a *TelebotAdapter) SendAlbum(images []*core.Image) ([]*core.Message, error)
- func (a *TelebotAdapter) SendImage(image *core.Image, caption string) (*core.Message, error)
- func (a *TelebotAdapter) SendMedia(media *core.Media) (*core.Message, error)
- func (a *TelebotAdapter) SendMediaAlbum(medias []*core.Media) ([]*core.Message, error)
- func (a *TelebotAdapter) SendText(text string, params ...interface{}) (*core.Message, error)
- func (a *TelebotAdapter) SendVideo(vf *core.Video, caption string) (*core.Message, error)
- func (a *TelebotAdapter) SetCommands(chatID int64, commands []core.Command) error
- type Telegraph
- type TikTokMediaFactory
- type Tweet
- type TweetScreenshot
- type TwitterAPI
- type TwitterApiCredentials
- type TwitterMediaFactory
- type URL
- type User
- type VideoInfo
- type VideoInfoVariant
- type VpnKey
- type YoutubeApi
- type YoutubeMediaFactory
- type YtDlpApi
- type YtDlpFormat
- type YtDlpResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateJsonCookieJar ¶
func CreateTikTokMediaFactory ¶
func CreateTikTokMediaFactory(l core.ILogger, api YoutubeApi) core.IMediaFactory
Types ¶
type CoreFactory ¶
type CoreFactory struct { }
type GraphQLResponse ¶
type GraphQLResponse struct { Errors []Error `json:"errors,omitempty"` Data GraphQLResponseData `json:"data"` }
type GraphQLResponseCore ¶
type GraphQLResponseCore struct {
UserResults GraphQLResponseUserResults `json:"user_results"`
}
type GraphQLResponseData ¶
type GraphQLResponseData struct {
TweetResult GraphQLResponseTweetResult `json:"tweetResult"`
}
type GraphQLResponseTweetResult ¶
type GraphQLResponseTweetResult struct {
Result GraphQLResponseTweetResultResult `json:"result"`
}
type GraphQLResponseTweetResultResult ¶
type GraphQLResponseTweetResultResult struct { Core GraphQLResponseCore `json:"core"` Legacy Tweet `json:"legacy"` RestId string `json:"rest_id"` }
type GraphQLResponseUserResults ¶
type GraphQLResponseUserResults struct {
Result GraphQLResponseUserResult `json:"result"`
}
type GraphQLVariables ¶
type HttpClient ¶
type HttpClient struct {
// contains filtered or unexported fields
}
func CreateHttpClient ¶
func CreateHttpClient() *HttpClient
func (*HttpClient) GetContent ¶
func (c *HttpClient) GetContent(url core.URL) (string, error)
GetContent is a core.IHttpClient interface implementation
func (*HttpClient) GetContentType ¶
func (c *HttpClient) GetContentType(url core.URL) (string, error)
GetContentType is a core.IHttpClient interface implementation
func (*HttpClient) GetRedirectLocation ¶
func (*HttpClient) SetHeader ¶
func (c *HttpClient) SetHeader(key string, value string)
SetHeader remembers all passed values and applies it to every request
type IgReel ¶
type IgReel struct {
Items []IgReelItem
}
type IgReelClipsMetadata ¶
type IgReelClipsMetadata struct { MusicInfo *IgReelMusicInfo `json:"music_info"` OriginalSoundInfo *IgReelOriginalSoundInfo `json:"original_sound_info"` }
type IgReelItem ¶
type IgReelItem struct { Code string User IgUser Caption IgCaption VideoDuration float64 `json:"video_duration"` VideoVersions []IgReelVideo `json:"video_versions"` ClipsMetadata IgReelClipsMetadata `json:"clips_metadata"` }
type IgReelMusicAssetInfo ¶
type IgReelMusicInfo ¶
type IgReelMusicInfo struct {
MusicAssetInfo IgReelMusicAssetInfo `json:"music_asset_info"`
}
type IgReelOriginalSoundInfo ¶
type IgReelOriginalSoundInfo struct {
ProgressiveDownloadURL string `json:"progressive_download_url"`
}
type IgReelVideo ¶
type InstagramAPI ¶
type InstagramAPI struct {
// contains filtered or unexported fields
}
Instagram API
type JsonCookieJar ¶
type JsonCookieJar struct {
// contains filtered or unexported fields
}
func (*JsonCookieJar) SetCookies ¶
func (jar *JsonCookieJar) SetCookies(u *url.URL, cookies []*http.Cookie)
type Media ¶
type Media struct { MediaUrlHttps string `json:"media_url_https"` Type string `json:"type"` VideoInfo VideoInfo `json:"video_info,omitempty"` }
Media ...
type OpenGraphParser ¶
type OpenGraphParser struct {
// contains filtered or unexported fields
}
func CreateOpenGraphParser ¶
func CreateOpenGraphParser(l core.ILogger) *OpenGraphParser
func (*OpenGraphParser) CreateMedia ¶
func (ogp *OpenGraphParser) CreateMedia(HTMLString string) ([]*core.Media, error)
CreateMedia is a core.IMediaFactory interface implementation
type OutlineAPI ¶
type OutlineAPI struct {
// contains filtered or unexported fields
}
func CreateOutlineAPI ¶
func CreateOutlineAPI(l core.ILogger, url string) *OutlineAPI
CreateOutlineAPI is a default OutlineAPI factory
type OutlineAPIKeys ¶
type OutlineAPIKeys struct {
AccessKeys []*VpnKey
}
type Telebot ¶
type Telebot struct {
// contains filtered or unexported fields
}
Telebot is a telegram API
func CreateTelebot ¶
CreateTelebot is a default Telebot factory
func (*Telebot) AddHandler ¶
func (t *Telebot) AddHandler(handler ...interface{})
AddHandler register object as one of core.Handler's
type TelebotAdapter ¶
type TelebotAdapter struct {
// contains filtered or unexported fields
}
TelebotAdapter combines Telebot and core.IBot
func (*TelebotAdapter) Delete ¶
func (a *TelebotAdapter) Delete(message *core.Message) error
Delete is a core.IBot interface implementation
func (*TelebotAdapter) Edit ¶
func (a *TelebotAdapter) Edit(message *core.Message, what interface{}, options ...interface{}) (*core.Message, error)
Edit is a core.IBot interface implementation
func (*TelebotAdapter) GetCommands ¶
func (a *TelebotAdapter) GetCommands(chatID int64) ([]core.Command, error)
GetCommands is a core.IBot interface implementation
func (*TelebotAdapter) IsUserMemberOfChat ¶
func (a *TelebotAdapter) IsUserMemberOfChat(user *core.User, chatID int64) bool
IsUserMemberOfChat is a core.IBot interface implementation
func (*TelebotAdapter) SendMediaAlbum ¶
SendMediaAlbum is a core.IBot interface implementation
func (*TelebotAdapter) SendText ¶
func (a *TelebotAdapter) SendText(text string, params ...interface{}) (*core.Message, error)
SendText is a core.IBot interface implementation
func (*TelebotAdapter) SetCommands ¶
func (a *TelebotAdapter) SetCommands(chatID int64, commands []core.Command) error
SetCommands is a core.IBot interface implementation
type Telegraph ¶
type Telegraph struct { }
Telegraph uploads files to telegra.ph
func CreateTelegraphAPI ¶
func CreateTelegraphAPI() *Telegraph
CreateTelegraphAPI is a default Telegraph factory
type TikTokMediaFactory ¶
type TikTokMediaFactory struct {
// contains filtered or unexported fields
}
func (*TikTokMediaFactory) CreateMedia ¶
func (factory *TikTokMediaFactory) CreateMedia(url string) ([]*core.Media, error)
type Tweet ¶
type Tweet struct { ID string `json:"id_str"` FullText string `json:"full_text"` Entities Entity `json:"entities"` ExtendedEntities Entity `json:"extended_entities,omitempty"` User User `json:"user,omitempty"` QuotedStatus *Tweet `json:"quoted_status,omitempty"` Errors []Error `json:"errors,omitempty"` }
Tweet is a twitter api representation of a single tweet
type TweetScreenshot ¶
type TwitterAPI ¶
type TwitterAPI struct {
// contains filtered or unexported fields
}
Twitter API
func CreateTwitterAPI ¶
func CreateTwitterAPI(l core.ILogger, t core.ITask) *TwitterAPI
CreateTwitterAPI is a default Twitter factory
type TwitterApiCredentials ¶
type TwitterApiCredentials struct {
// contains filtered or unexported fields
}
type TwitterMediaFactory ¶
type TwitterMediaFactory struct {
// contains filtered or unexported fields
}
func CreateTwitterMediaFactory ¶
func CreateTwitterMediaFactory(l core.ILogger, t core.ITask) *TwitterMediaFactory
func (*TwitterMediaFactory) CreateMedia ¶
func (tmf *TwitterMediaFactory) CreateMedia(tweetID string) ([]*core.Media, error)
CreateMedia is a core.IMediaFactory interface implementation
type VideoInfo ¶
type VideoInfo struct { Duration uint `json:"duration_millis"` Variants []VideoInfoVariant `json:"variants"` }
VideoInfo ...
type VideoInfoVariant ¶
type VideoInfoVariant struct { Bitrate int `json:"bitrate"` ContentType string `json:"content_type"` URL string `json:"url"` }
VideoInfoVariant ...
type YoutubeApi ¶
type YoutubeApi interface {
// contains filtered or unexported methods
}
func CreateYtDlpApi ¶
func CreateYtDlpApi(l core.ILogger) YoutubeApi
type YoutubeMediaFactory ¶
type YoutubeMediaFactory struct {
// contains filtered or unexported fields
}
func CreateYoutubeMediaFactory ¶
func CreateYoutubeMediaFactory(l core.ILogger, api YoutubeApi, fd core.IFileDownloader) *YoutubeMediaFactory
func (*YoutubeMediaFactory) CreateMedia ¶
func (y *YoutubeMediaFactory) CreateMedia(url string) ([]*core.Media, error)
CreateMedia is a core.IMediaFactory interface implementation
func (*YoutubeMediaFactory) CreateVideo ¶
func (y *YoutubeMediaFactory) CreateVideo(id string) (*core.Video, error)
CreateVideo is a core.IVideoFactory interface implementation
type YtDlpFormat ¶
type YtDlpFormat struct { Ext string `json:"ext"` FormatId string `json:"format_id"` Format string `json:"format"` FormatNote string `json:"format_note"` Filesize int64 `json:"filesize,omitempty"` Height int `json:"height"` Width int `json:"width"` Acodec string `json:"acodec"` Vcodec string `json:"vcodec"` Url string `json:"url"` }
type YtDlpResponse ¶
type YtDlpResponse struct { Id string `json:"id"` Title string `json:"title"` Description string `json:"description"` Creator string `json:"creator,omitempty"` // tiktok Track string `json:"track,omitempty"` // tiktok Artist string `json:"artist,omitempty"` // tiktok Duration float64 `json:"duration"` ExtractorKey string `json:"extractor_key"` Thumbnail string `json:"thumbnail"` Uploader string `json:"uploader"` Url string `json:"url,omitempty"` Formats []*YtDlpFormat `json:"formats"` }