instagram

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 11, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportToString

func ExportToString(client *Instagram) (string, error)

Types

type Account

type Account struct {
	ID                         int64        `json:"pk"`
	Username                   string       `json:"username"`
	FullName                   string       `json:"full_name"`
	Biography                  string       `json:"biography"`
	ProfilePicURL              string       `json:"profile_pic_url"`
	Email                      string       `json:"email"`
	PhoneNumber                string       `json:"phone_number"`
	IsBusiness                 bool         `json:"is_business"`
	Gender                     int          `json:"gender"`
	ProfilePicID               string       `json:"profile_pic_id"`
	CanSeeOrganicInsights      bool         `json:"can_see_organic_insights"`
	ShowInsightsTerms          bool         `json:"show_insights_terms"`
	Nametag                    nametag      `json:"nametag"`
	HasAnonymousProfilePicture bool         `json:"has_anonymous_profile_picture"`
	IsPrivate                  bool         `json:"is_private"`
	IsUnpublished              bool         `json:"is_unpublished"`
	AllowedCommenterType       string       `json:"allowed_commenter_type"`
	IsVerified                 bool         `json:"is_verified"`
	MediaCount                 int          `json:"media_count"`
	FollowerCount              int          `json:"follower_count"`
	FollowingCount             int          `json:"following_count"`
	GeoMediaCount              int          `json:"geo_media_count"`
	ExternalURL                string       `json:"external_url"`
	HasBiographyTranslation    bool         `json:"has_biography_translation"`
	ExternalLynxURL            string       `json:"external_lynx_url"`
	HdProfilePicURLInfo        picURLInfo   `json:"hd_profile_pic_url_info"`
	HdProfilePicVersions       []picURLInfo `json:"hd_profile_pic_versions"`
	UsertagsCount              int          `json:"usertags_count"`
	HasChaining                bool         `json:"has_chaining"`
	ReelAutoArchive            string       `json:"reel_auto_archive"`
	PublicEmail                string       `json:"public_email"`
	PublicPhoneNumber          string       `json:"public_phone_number"`
	PublicPhoneCountryCode     string       `json:"public_phone_country_code"`
	ContactPhoneNumber         string       `json:"contact_phone_number"`
	Byline                     string       `json:"byline"`
	SocialContext              string       `json:"social_context,omitempty"`
	SearchSocialContext        string       `json:"search_social_context,omitempty"`
	MutualFollowersCount       float64      `json:"mutual_followers_count"`
	LatestReelMedia            int64        `json:"latest_reel_media,omitempty"`
	CityID                     int64        `json:"city_id"`
	CityName                   string       `json:"city_name"`
	AddressStreet              string       `json:"address_street"`
	DirectMessaging            string       `json:"direct_messaging"`
	Latitude                   float64      `json:"latitude"`
	Longitude                  float64      `json:"longitude"`
	Category                   string       `json:"category"`
	BusinessContactMethod      string       `json:"business_contact_method"`
	IsCallToActionEnabled      bool         `json:"is_call_to_action_enabled"`
	FbPageCallToActionID       string       `json:"fb_page_call_to_action_id"`
	Zip                        string       `json:"zip"`
	AllowContactsSync          bool         `json:"allow_contacts_sync"`
	CanBoostPost               bool         `json:"can_boost_post"`
	// contains filtered or unexported fields
}

func (*Account) Sync

func (account *Account) Sync() error

type Challenge

type Challenge struct {
	StepName     string            `json:"step_name"`
	StepData     ChallengeStepData `json:"step_data"`
	LoggedInUser *Account          `json:"logged_in_user,omitempty"`
	UserID       int64             `json:"user_id"`
	NonceCode    string            `json:"nonce_code"`
	Action       string            `json:"action"`
	Status       string            `json:"status"`
	// contains filtered or unexported fields
}

func (*Challenge) Process

func (challenge *Challenge) Process(apiURL string) error

func (*Challenge) SendSecurityCode

func (challenge *Challenge) SendSecurityCode(code string) error

type ChallengeError

type ChallengeError struct {
	Message   string `json:"message"`
	Challenge struct {
		URL               string `json:"url"`
		APIPath           string `json:"api_path"`
		HideWebviewHeader bool   `json:"hide_webview_header"`
		Lock              bool   `json:"lock"`
		Logout            bool   `json:"logout"`
		NativeFlow        bool   `json:"native_flow"`
	} `json:"challenge"`
	Status    string `json:"status"`
	ErrorType string `json:"error_type"`
}

func (ChallengeError) Error

func (e ChallengeError) Error() string

type ChallengeProcessError

type ChallengeProcessError struct {
	StepName string
}

func (ChallengeProcessError) Error

func (e ChallengeProcessError) Error() string

type ChallengeStepData

type ChallengeStepData struct {
	Choice           string      `json:"choice"`
	FbAccessToken    string      `json:"fb_access_token"`
	BigBlueToken     string      `json:"big_blue_token"`
	GoogleOauthToken string      `json:"google_oauth_token"`
	Email            string      `json:"email"`
	SecurityCode     string      `json:"security_code"`
	ResendDelay      interface{} `json:"resend_delay"`
	ContactPoint     string      `json:"contact_point"`
	FormType         string      `json:"form_type"`
}

type HTTPError4xx

type HTTPError4xx struct {
	ChallengeError
	Action     string `json:"action"`
	StatusCode string `json:"status_code"`
	Payload    struct {
		ClientContext string `json:"client_context"`
		Message       string `json:"message"`
	} `json:"payload"`
	Status string `json:"status"`
}

type HTTPGenericError

type HTTPGenericError struct {
	Message   string `json:"message"`
	Status    string `json:"status"`
	ErrorType string `json:"error_type"`
}

func (HTTPGenericError) Error

func (e HTTPGenericError) Error() string

type Instagram

type Instagram struct {
	Account   *Account
	Live      *Live
	Challenge *Challenge
	// contains filtered or unexported fields
}

func ImportFromString

func ImportFromString(base64String string) (*Instagram, error)

func New

func New(username, password string) *Instagram

func (*Instagram) GetThumbnailAsJPEG

func (i *Instagram) GetThumbnailAsJPEG(url string, quality int) ([]byte, error)

func (*Instagram) Login

func (i *Instagram) Login() error

func (*Instagram) Logout

func (i *Instagram) Logout() (*LogoutResponse, error)

func (*Instagram) UploadPhoto

func (i *Instagram) UploadPhoto(photo io.Reader) (string, error)

type Live

type Live struct {
	// contains filtered or unexported fields
}

func (*Live) AddPostLiveToIGTV

func (live *Live) AddPostLiveToIGTV(broadcastID int, coverUploadID string, title string, description string, sharePreviewToFeed bool) (*LiveAddPostLiveToIGTVResponse, error)

func (*Live) Comment added in v1.0.4

func (live *Live) Comment(broadcastID int, message string) (*LiveCommentResponse, error)

func (*Live) Create

func (live *Live) Create(width int, height int, message string) (*LiveCreateResponse, error)

func (*Live) DisableRequestToJoin added in v1.0.3

func (live *Live) DisableRequestToJoin(broadcastID int) (*LiveDisableRequestToJoinResponse, error)

func (*Live) End

func (live *Live) End(broadcastID int, endAfterCopyrightWarning bool) (*LiveEndResponse, error)

func (*Live) GetComment

func (live *Live) GetComment(broadcastID int, numCommentsRequested int, lastCommentTS int) (*LiveGetCommentResponse, error)

func (*Live) GetFinalViewerList added in v1.0.3

func (live *Live) GetFinalViewerList(broadcastID int) (*LiveGetFinalViewerListResponse, error)

func (*Live) GetPostLiveThumbnails

func (live *Live) GetPostLiveThumbnails(broadcastID int) (*LiveGetPostLiveThumbnailsResponse, error)

func (*Live) HeartbeatAndGetViewerCount

func (live *Live) HeartbeatAndGetViewerCount(broadcastID int) (*LiveHeartbeatAndGetViewerCountResponse, error)

func (*Live) Info

func (live *Live) Info(broadcastID int) (*LiveInfoResponse, error)

func (*Live) PinComment added in v1.0.4

func (live *Live) PinComment(broadcastID int, commentID int64) (*LivePinCommentResponse, error)

func (*Live) Start

func (live *Live) Start(broadcastID int, notify bool) (*LiveStartResponse, error)

func (*Live) UnmuteComment

func (live *Live) UnmuteComment(broadcastID int) (*LiveUnmuteCommentResponse, error)

type LiveAddPostLiveToIGTVResponse

type LiveAddPostLiveToIGTVResponse struct {
	Success    bool   `json:"success"`
	IGTVPostID int64  `json:"igtv_post_id"`
	Status     string `json:"status"`
}

type LiveAddToPostResponse

type LiveAddToPostResponse struct {
	Status string `json:"status"`
}

type LiveComment

type LiveComment struct {
	PK              int64  `json:"pk"`
	UserID          int    `json:"user_id"`
	Text            string `json:"text"`
	Type            int    `json:"type"`
	CreatedAt       int    `json:"created_at"`
	CreatedAtUtc    int    `json:"created_at_utc"`
	ContentType     string `json:"content_type"`
	Status          string `json:"status"`
	BitFlags        int    `json:"bit_flags"`
	DidReportAsSpam bool   `json:"did_report_as_spam"`
	ShareEnabled    bool   `json:"share_enabled"`
	User            struct {
		PK                  int64  `json:"pk"`
		Username            string `json:"username"`
		FullName            string `json:"full_name"`
		IsPrivate           bool   `json:"is_private"`
		ProfilePicURL       string `json:"profile_pic_url"`
		ProfilePicID        string `json:"profile_pic_id"`
		IsVerified          bool   `json:"is_verified"`
		LiveWithEligibility string `json:"live_with_eligibility"`
	} `json:"user"`
}

type LiveCommentResponse added in v1.0.4

type LiveCommentResponse struct {
	Comment struct {
		PK int64 `json:"pk"`
	} `json:"comment"`
	Status string `json:"status"`
}

type LiveCreateResponse

type LiveCreateResponse struct {
	BroadcastID int    `json:"broadcast_id"`
	UploadURL   string `json:"upload_url"`
	Status      string `json:"status"`
}

type LiveDisableRequestToJoinResponse added in v1.0.3

type LiveDisableRequestToJoinResponse struct {
	Status string `json:"status"`
}

type LiveEndResponse

type LiveEndResponse struct {
	Status string `json:"status"`
}

type LiveGetCommentResponse

type LiveGetCommentResponse struct {
	CommentLikesEnabled        bool          `json:"comment_likes_enabled"`
	Comments                   []LiveComment `json:"comments"`
	CommentCount               int           `json:"comment_count"`
	Caption                    interface{}   `json:"caption"`
	CaptionIsEdited            bool          `json:"caption_is_edited"`
	HasMoreComments            bool          `json:"has_more_comments"`
	HasMoreHeadloadComments    bool          `json:"has_more_headload_comments"`
	MediaHeaderDisplay         string        `json:"media_header_display"`
	CanViewMorePreviewComments bool          `json:"can_view_more_preview_comments"`
	LiveSecondsPerComment      int           `json:"live_seconds_per_comment"`
	IsFirstFetch               string        `json:"is_first_fetch"`
	SystemComments             interface{}   `json:"system_comments"`
	CommentMuted               int           `json:"comment_muted"`
	Status                     string        `json:"status"`
}

type LiveGetFinalViewerListResponse added in v1.0.3

type LiveGetFinalViewerListResponse struct {
	Users                  []LiveViewerUser `json:"users"`
	TotalUniqueViewerCount int              `json:"total_unique_viewer_count"`
	Status                 string           `json:"status"`
}

type LiveGetPostLiveThumbnailsResponse

type LiveGetPostLiveThumbnailsResponse struct {
	Thumbnails []string `json:"thumbnails"`
	Status     string   `json:"status"`
}

type LiveHeartbeatAndGetViewerCountResponse

type LiveHeartbeatAndGetViewerCountResponse struct {
	ViewerCount            float64 `json:"viewer_count"`
	BroadcastStatus        string  `json:"broadcast_status"`
	OffsetToVideoStart     int     `json:"offset_to_video_start"`
	TotalUniqueViewerCount int     `json:"total_unique_viewer_count"`
	IsTopLiveEligible      int     `json:"is_top_live_eligible"`
	Status                 string  `json:"status"`
}

type LiveInfoResponse

type LiveInfoResponse struct {
	ID                             int     `json:"id"`
	RTMPPlaybackURL                string  `json:"rtmp_playback_url"`
	DASHPlaybackURL                string  `json:"dash_playback_url"`
	DASHABRPlaybackURL             string  `json:"dash_abr_playback_url"`
	DASHPLivePredictivePlaybackURL string  `json:"dash_live_predictive_playback_url"`
	BroadcastStatus                string  `json:"broadcast_status"`
	ViewerCount                    float64 `json:"viewer_count"`
	InternalOnly                   bool    `json:"internal_only"`
	PublishedTime                  int     `json:"published_time"`
	HideFromFeedUnit               bool    `json:"hide_from_feed_unit"`
	MediaID                        string  `json:"media_id"`
	BroadcastMessage               string  `json:"broadcast_message"`
	Status                         string  `json:"status"`
}

type LivePinCommentResponse added in v1.0.4

type LivePinCommentResponse struct {
	Status string `json:"status"`
}

type LiveStartResponse

type LiveStartResponse struct {
	MediaID string `json:"media_id"`
	Status  string `json:"status"`
}

type LiveUnmuteCommentResponse

type LiveUnmuteCommentResponse struct {
	CommentMuted int    `json:"comment_muted"`
	Status       string `json:"status"`
}

type LiveViewerUser added in v1.0.3

type LiveViewerUser struct {
	PK            int64  `json:"pk"`
	Username      string `json:"username"`
	FullName      string `json:"full_name"`
	IsPrivate     bool   `json:"is_private"`
	ProfilePicURL string `json:"profile_pic_url"`
	ProfilePicID  string `json:"profile_pic_id"`
	IsVerified    bool   `json:"is_verified"`
}

type LoginRequiredError

type LoginRequiredError struct {
	Message      string `json:"message"`
	ErrorTitle   string `json:"error_title"`
	ErrorBody    string `json:"error_body"`
	LogoutReason int    `json:"logout_reason"`
	Status       string `json:"status"`
}

func (LoginRequiredError) Error

func (e LoginRequiredError) Error() string

type LogoutResponse

type LogoutResponse struct {
	Status string `json:"status"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL