douyin

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceTypeShardContent = iota
	SourceTypeVideoId
)

Variables

View Source
var (
	DefaultUserAgent = `` /* 135-byte string literal not displayed */

)

Functions

func HandleDouyinReq

func HandleDouyinReq(c *gin.Context, log *logrus.Logger, shareLink string)

func SetupHeaders

func SetupHeaders() http.Header

Types

type DouYin

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

func NewDouYin

func NewDouYin(log *logrus.Logger) *DouYin

func (*DouYin) Get

func (d *DouYin) Get(src Source) (v Video, err error)

func (*DouYin) GetAllVideoIDList

func (d *DouYin) GetAllVideoIDList(secUid string) ([]string, error)

func (*DouYin) GetRedirectUrl

func (d *DouYin) GetRedirectUrl(urlStr string) (string, error)

func (*DouYin) GetVideoInfo

func (d *DouYin) GetVideoInfo(urlStr string) (string, error)

type ImageItem

type ImageItem struct {
	ImageUrl string `json:"image_url"`
	ImageId  string `json:"image_id"`
}

type Source

type Source struct {
	Type    SourceType
	Content string
}

type SourceType

type SourceType uint

type Video

type Video struct {
	VideoId         string   `json:"video_id"`
	PlayId          string   `json:"play_id"`
	PlayAddr        string   `json:"play_addr"`
	VideoRawAddr    string   `json:"video_raw_addr"`
	PlayRawAddr     string   `json:"play_raw_addr"`
	OriginCoverList []string `json:"origin_cover_list"`
	Desc            string   `json:"desc"`
	RawLink         string   `json:"raw_link"`
	Author          struct {
		Id           string `json:"id"`
		ShortId      string `json:"short_id"`
		Nickname     string `json:"nickname"`
		AvatarLarger string `json:"avatar_larger"`
		Signature    string `json:"signature"`
	} `json:"author"`
	Images    []string  `json:"images"`
	VideoType VideoType `json:"video_type"`
	// contains filtered or unexported fields
}

Video 抖音视频

func (*Video) String

func (v *Video) String() string

type VideoType

type VideoType int

VideoType 视频类型

const (
	//VideoPlayType 视频类
	VideoPlayType VideoType = 0
	//ImagePlayType 图文类
	ImagePlayType VideoType = 1
)

Jump to

Keyboard shortcuts

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