parser

package
v0.0.0-...-0e829d5 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SourceDouYin       = "douyin"       // 抖音
	SourceKuaiShou     = "kuaishou"     // 快手
	SourcePiPiXia      = "pipixia"      // 皮皮虾
	SourceHuoShan      = "huoshan"      // 火山
	SourceWeiBo        = "weibo"        // 微博
	SourceWeiShi       = "weishi"       // 微视
	SourceLvZhou       = "lvzhou"       // 绿洲
	SourceZuiYou       = "zuiyou"       // 最右
	SourceQuanMin      = "quanmin"      // 度小视(原 全民小视频)
	SourceXiGua        = "xigua"        // 西瓜
	SourceLiShiPin     = "lishipin"     // 梨视频
	SourcePiPiGaoXiao  = "pipigaoxiao"  // 皮皮搞笑
	SourceHuYa         = "huya"         // 虎牙
	SourceAcFun        = "acfun"        // A站
	SourceDouPai       = "doupai"       // 逗拍
	SourceMeiPai       = "meipai"       // 美拍
	SourceQuanMinKGe   = "quanminkge"   // 全民K歌
	SourceSixRoom      = "sixroom"      // 六间房
	SourceXinPianChang = "xinpianchang" // 新片场
	SourceHaoKan       = "haokan"       // 好看视频
)

视频渠道来源

View Source
const (
	HttpHeaderUserAgent   = "User-Agent" //http header
	HttpHeaderReferer     = "Referer"
	HttpHeaderContentType = "Content-Type"
	HttpHeaderCookie      = "Cookie"

	// DefaultUserAgent 默认UserAgent
	DefaultUserAgent = "" /* 135-byte string literal not displayed */
)

http 相关

Variables

This section is empty.

Functions

func BatchParseVideoId

func BatchParseVideoId(source string, videoIds []string) (map[string]BatchParseItem, error)

BatchParseVideoId 根据视频id批量解析视频信息

Types

type BatchParseItem

type BatchParseItem struct {
	ParseInfo *VideoParseInfo // 视频解析信息
	Error     error           // 错误, 如果单条解析失败时, 记录error信息
}

BatchParseItem 批量解析时, 单条解析格式

type VideoParseInfo

type VideoParseInfo struct {
	Author struct {
		Uid    string `json:"uid"`    // 作者id
		Name   string `json:"name"`   // 作者名称
		Avatar string `json:"avatar"` // 作者头像
	} `json:"author"`
	Title    string   `json:"title"`     // 描述
	VideoUrl string   `json:"video_url"` // 视频播放地址
	MusicUrl string   `json:"music_url"` // 音乐播放地址
	CoverUrl string   `json:"cover_url"` // 视频封面地址
	Images   []string `json:"images"`    // 图集图片地址列表
}

VideoParseInfo 视频解析信息

func ParseVideoId

func ParseVideoId(source, videoId string) (*VideoParseInfo, error)

ParseVideoId 根据视频id解析视频信息

func ParseVideoShareUrl

func ParseVideoShareUrl(shareUrl string) (*VideoParseInfo, error)

ParseVideoShareUrl 根据视频分享链接解析视频信息

Jump to

Keyboard shortcuts

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