fetcherapi

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 {
	ID       string `json:"id"`
	UniqueID string `json:"unique_id"`
	Nickname string `json:"nickname"`
	Avatar   string `json:"avatar"`
}

type Data

type Data struct {
	AwemeID       string    `json:"aweme_id"`
	ID            string    `json:"id"`
	Region        string    `json:"region"`
	Title         string    `json:"title"`
	Cover         string    `json:"cover"`
	OriginCover   string    `json:"origin_cover"`
	Duration      int       `json:"duration"`
	Play          string    `json:"play"`
	WmPlay        string    `json:"wmplay"`
	Size          int       `json:"size"`
	WmSize        int       `json:"wm_size"`
	Music         string    `json:"music"`
	MusicInfo     MusicInfo `json:"music_info"`
	PlayCount     int       `json:"play_count"`
	DiggCount     int       `json:"digg_count"`
	CommentCount  int       `json:"comment_count"`
	ShareCount    int       `json:"share_count"`
	DownloadCount int       `json:"download_count"`
	CreateTime    int64     `json:"create_time"`
	Author        Author    `json:"author"`
}

type Fetcher

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

func New

func New(apiKey string) *Fetcher

func (*Fetcher) GetVideoURL

func (t *Fetcher) GetVideoURL(tiktokURL string) (string, error)

GetVideoURL fetches the video URL using the unofficial TikTok API

type MusicInfo

type MusicInfo struct {
	ID       string `json:"id"`
	Title    string `json:"title"`
	Play     string `json:"play"`
	Cover    string `json:"cover"`
	Author   string `json:"author"`
	Original bool   `json:"original"`
	Duration int    `json:"duration"`
	Album    string `json:"album"`
}

type Response

type Response struct {
	Code          int     `json:"code"`
	Msg           string  `json:"msg"`
	ProcessedTime float64 `json:"processed_time"`
	Data          Data    `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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