parser

package
v0.0.0-...-ed78a8b Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SourceDouYin represents the source "douyin" (抖音)
	SourceDouYin = "douyin"
	// SourceKuaiShou represents the source "kuaishou" (快手)
	SourceKuaiShou = "kuaishou"
	// SourceTiktok represents the source "tiktok"
	SourceTiktok = "tiktok"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	UID        string      `json:"uid"`         // 作者id
	Name       string      `json:"name"`        // 作者名称
	Avatar     string      `json:"avatar"`      // 作者头像
	SourceData interface{} `json:"source_data"` // 作者
}

Author represents the author information.

type HTTPResponse

type HTTPResponse struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

HTTPResponse represents the structure of an HTTP response.

type Source

type Source struct {
	Data any `json:"data"`
}

Source represents the parsed information based on .

type SourceVideoInfo

type SourceVideoInfo struct {
	Title      string   `json:"title"`     // 描述
	VideoURL   string   `json:"video_url"` // 视频播放地址
	MusicURL   string   `json:"music_url"` // 音乐播放地址
	CoverURL   string   `json:"cover_url"` // 视频封面地址
	Images     []string `json:"images"`    // 图集图片地址列表
	SourceData Source   `json:"video_src"`
}

SourceVideoInfo represents the video information.

type VideoParseInfo

type VideoParseInfo struct {
	Author       Author          `json:"author"`
	AuthorSource Source          `json:"author_src"`
	Video        SourceVideoInfo `json:"video"`
	VideoSrc     Source          `json:"video_src"`
}

VideoParseInfo 视频解析信息

func Parse

func Parse(c *gin.Context) (*VideoParseInfo, error)

Parse parses video information from the given context.

type VideoParser

type VideoParser struct {
	VideoShareURLParser videoShareURLParser
	VideoIDParser       videoIDParser
}

VideoParser is a parser for video information.

Jump to

Keyboard shortcuts

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