scraperapi

package
v0.0.0-...-b18db6d Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: 0BSD Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	Avatar168x168          Image     `json:"avatar_168x168"`
	Avatar300x300          Image     `json:"avatar_300x300"`
	AvatarLarger           Image     `json:"avatar_larger"`
	AvatarMedium           Image     `json:"avatar_medium"`
	AvatarThumb            Image     `json:"avatar_thumb"`
	AvatarURI              string    `json:"avatar_uri"`
	AwemeCount             int       `json:"aweme_count"`
	CoverURL               []Image   `json:"cover_url"`
	DuetSetting            int       `json:"duet_setting"`
	EnterpriseVerifyReason string    `json:"enterprise_verify_reason"`
	FavoritingCount        int       `json:"favoriting_count"`
	FollowerCount          int       `json:"follower_count"`
	FollowingCount         int       `json:"following_count"`
	InsID                  string    `json:"ins_id"`
	Language               string    `json:"language"`
	Nickname               string    `json:"nickname"`
	OriginalMusician       Musician  `json:"original_musician"`
	Region                 string    `json:"region"`
	SecUID                 string    `json:"sec_uid"`
	ShareInfo              ShareInfo `json:"share_info"`
	ShortID                string    `json:"short_id"`
	TotalFavorited         int64     `json:"total_favorited"`
	UID                    string    `json:"uid"`
	UniqueID               string    `json:"unique_id"`
	UniqueIDModifyTime     int64     `json:"unique_id_modify_time"`
	UserMode               int       `json:"user_mode"`
	UserRate               int       `json:"user_rate"`
	VerificationType       int       `json:"verification_type"`
	VideoIcon              Image     `json:"video_icon"`
}

type Avatar

type Avatar struct {
	URI     string   `json:"uri"`
	URLList []string `json:"url_list"`
}

type Aweme

type Aweme struct {
	AwemeID        string       `json:"aweme_id"`
	Desc           string       `json:"desc"`
	CreateTime     int64        `json:"create_time"`
	Author         Author       `json:"author"`
	Music          Music        `json:"music"`
	ChaList        []ChaList    `json:"cha_list"`
	Video          Video        `json:"video"`
	ShareURL       string       `json:"share_url"`
	Statistics     Statistics   `json:"statistics"`
	Status         Status       `json:"status"`
	Rate           int          `json:"rate"`
	TextExtra      []TextExtra  `json:"text_extra"`
	LabelTop       Image        `json:"label_top"`
	ShareInfo      ShareInfo    `json:"share_info"`
	AwemeType      int          `json:"aweme_type"`
	AuthorUserID   int64        `json:"author_user_id"`
	IsHashTag      int          `json:"is_hash_tag"`
	Region         string       `json:"region"`
	GroupID        string       `json:"group_id"`
	DescLanguage   string       `json:"desc_language"`
	MiscInfo       string       `json:"misc_info"`
	DistributeType int          `json:"distribute_type"`
	VideoControl   VideoControl `json:"video_control"`
}

type ChaList

type ChaList struct {
	Desc    string `json:"desc"`
	Type    int    `json:"type"`
	CID     string `json:"cid"`
	ChaName string `json:"cha_name"`
}

type CommerceUserInfo

type CommerceUserInfo struct {
	AdExperienceEntry bool     `json:"ad_experience_entry"`
	AdExperienceText  string   `json:"ad_experience_text"`
	AdRevenueRits     []string `json:"ad_revenue_rits"`
}

type DataShareInfo

type DataShareInfo struct {
	ShareURL         string `json:"share_url"`
	ShareDesc        string `json:"share_desc"`
	ShareTitle       string `json:"share_title"`
	BoolPersist      int    `json:"bool_persist"`
	ShareTitleMyself string `json:"share_title_myself"`
	ShareTitleOther  string `json:"share_title_other"`
	ShareDescInfo    string `json:"share_desc_info"`
}

type FeedChunk

type FeedChunk struct {
	MinCursor int64   `json:"min_cursor"`
	MaxCursor int64   `json:"max_cursor"`
	HasMore   int     `json:"has_more"`
	AwemeList []Aweme `json:"aweme_list"`
}

type Image

type Image struct {
	URI     string   `json:"uri"`
	URLList []string `json:"url_list"`
	Width   int      `json:"width"`
	Height  int      `json:"height"`
}

type Music

type Music struct {
	ID            int64  `json:"id"`
	Title         string `json:"title"`
	Author        string `json:"author"`
	Album         string `json:"album"`
	IsOriginal    bool   `json:"is_original"`
	OwnerID       string `json:"owner_id"`
	OwnerNickname string `json:"owner_nickname"`
}

type Musician

type Musician struct {
	DiggCount      int `json:"digg_count"`
	MusicCount     int `json:"music_count"`
	MusicUsedCount int `json:"music_used_count"`
}

type OriginalMusician

type OriginalMusician struct {
	DiggCount      int `json:"digg_count"`
	MusicCount     int `json:"music_count"`
	MusicUsedCount int `json:"music_used_count"`
}

type PrivacySetting

type PrivacySetting struct {
	FollowingVisibility int `json:"following_visibility"`
}

type PrivateTab

type PrivateTab struct {
	PrivateTabStyle int  `json:"private_tab_style"`
	ShowPrivateTab  bool `json:"show_private_tab"`
}

type ReviewResult

type ReviewResult struct {
	ReviewStatus int `json:"review_status"`
}

type Scraper

type Scraper struct {
	APIHost    string
	APIKey     string
	RateLimit  ratelimit.Limiter
	HttpClient *http.Client
}

func New

func New(apiKey string) *Scraper

func (*Scraper) FetchUserAwemeList

func (t *Scraper) FetchUserAwemeList(userId string) ([]Aweme, error)

func (*Scraper) FetchUserAwemeListAfterCursor

func (t *Scraper) FetchUserAwemeListAfterCursor(userId string, cursor int64) ([]Aweme, error)

func (*Scraper) FetchUserData

func (t *Scraper) FetchUserData(userId string) (*User, error)

func (*Scraper) FetchUserFeed

func (t *Scraper) FetchUserFeed(userId string, maxCursor int64) (*FeedChunk, error)

func (*Scraper) FetchUserId

func (t *Scraper) FetchUserId(username string) (string, error)

type ShareInfo

type ShareInfo struct {
	ShareDescInfo string `json:"share_desc_info"`
}

type Statistics

type Statistics struct {
	AwemeID            string `json:"aweme_id"`
	CommentCount       int    `json:"comment_count"`
	DiggCount          int    `json:"digg_count"`
	DownloadCount      int    `json:"download_count"`
	PlayCount          int    `json:"play_count"`
	ShareCount         int    `json:"share_count"`
	ForwardCount       int    `json:"forward_count"`
	LoseCount          int    `json:"lose_count"`
	LoseCommentCount   int    `json:"lose_comment_count"`
	WhatsAppShareCount int    `json:"whatsapp_share_count"`
}

type Status

type Status struct {
	AwemeID        string       `json:"aweme_id"`
	IsDelete       bool         `json:"is_delete"`
	AllowShare     bool         `json:"allow_share"`
	AllowComment   bool         `json:"allow_comment"`
	PrivateStatus  int          `json:"private_status"`
	InReviewing    bool         `json:"in_reviewing"`
	Reviewed       int          `json:"reviewed"`
	SelfSee        bool         `json:"self_see"`
	IsProhibited   bool         `json:"is_prohibited"`
	DownloadStatus int          `json:"download_status"`
	ReviewResult   ReviewResult `json:"review_result"`
	VideoMute      VideoMute    `json:"video_mute"`
}

type TabSettings

type TabSettings struct {
	PrivateTab PrivateTab `json:"private_tab"`
}

type TextExtra

type TextExtra struct {
	Start       int    `json:"start"`
	End         int    `json:"end"`
	HashtagID   string `json:"hashtag_id,omitempty"`
	HashtagName string `json:"hashtag_name,omitempty"`
	SecUID      string `json:"sec_uid,omitempty"`
	UserID      string `json:"user_id,omitempty"`
	Type        int    `json:"type,omitempty"`
}

type User

type User struct {
	AccountType            int              `json:"account_type"`
	Avatar168x168          Avatar           `json:"avatar_168x168"`
	Avatar300x300          Avatar           `json:"avatar_300x300"`
	AvatarLarger           Avatar           `json:"avatar_larger"`
	AvatarMedium           Avatar           `json:"avatar_medium"`
	AvatarThumb            Avatar           `json:"avatar_thumb"`
	AwemeCount             int              `json:"aweme_count"`
	BioSecureURL           string           `json:"bio_secure_url"`
	BioURL                 string           `json:"bio_url"`
	CommerceUserInfo       CommerceUserInfo `json:"commerce_user_info"`
	EnterpriseVerifyReason string           `json:"enterprise_verify_reason"`
	FollowerCount          int              `json:"follower_count"`
	FollowingCount         int              `json:"following_count"`
	InsID                  string           `json:"ins_id"`
	Nickname               string           `json:"nickname"`
	OriginalMusician       OriginalMusician `json:"original_musician"`
	PrivacySetting         PrivacySetting   `json:"privacy_setting"`
	SecUID                 string           `json:"sec_uid"`
	ShareInfo              DataShareInfo    `json:"share_info"`
	ShortID                string           `json:"short_id"`
	SignatureLanguage      string           `json:"signature_language"`
	TabSettings            TabSettings      `json:"tab_settings"`
	TotalFavorited         int              `json:"total_favorited"`
	UID                    string           `json:"uid"`
	UniqueID               string           `json:"unique_id"`
	VideoIcon              VideoIcon        `json:"video_icon"`
}

type UserDataResponse

type UserDataResponse struct {
	Status string     `json:"status"`
	Data   UserLookup `json:"data"`
}

type UserFeedResponse

type UserFeedResponse struct {
	Status string    `json:"status"`
	Data   FeedChunk `json:"data"`
}

type UserLookup

type UserLookup struct {
	StatusCode int  `json:"status_code"`
	User       User `json:"user"`
}

type Video

type Video struct {
	Width        int  `json:"width"`
	Height       int  `json:"height"`
	Duration     int  `json:"duration"`
	HasWatermark bool `json:"has_watermark"`
}

type VideoControl

type VideoControl struct {
	AllowDownload         bool `json:"allow_download"`
	ShareType             int  `json:"share_type"`
	ShowProgressBar       int  `json:"show_progress_bar"`
	DraftProgressBar      int  `json:"draft_progress_bar"`
	AllowDuet             bool `json:"allow_duet"`
	AllowReact            bool `json:"allow_react"`
	PreventDownloadType   int  `json:"prevent_download_type"`
	AllowDynamicWallpaper bool `json:"allow_dynamic_wallpaper"`
	TimerStatus           int  `json:"timer_status"`
	AllowMusic            bool `json:"allow_music"`
	AllowStitch           bool `json:"allow_stitch"`
}

type VideoIcon

type VideoIcon struct {
	URI     string   `json:"uri"`
	URLList []string `json:"url_list"`
}

type VideoMute

type VideoMute struct {
	IsMute   bool   `json:"is_mute"`
	MuteDesc string `json:"mute_desc"`
}

Jump to

Keyboard shortcuts

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