videos

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrVideoNotFound = errors.New("video not found")

Functions

func EnableYouTubeAPI

func EnableYouTubeAPI(apiKey string) error
func IsYouTubeLink(videoURL *url.URL) bool

Types

type Options

type Options struct {
	// Do not attempt to use kkdai/youtube before trying to use yt-dlp
	SkipFastYouTube bool
	// Disable retry attempts when kkdai/youtube fails
	DisableFastYouTubeRetry bool
}

type VideoInfo

type VideoInfo struct {
	URL            string        `json:"url"`
	Platform       string        `json:"platform"`
	ID             string        `json:"video_id"`
	Title          string        `json:"video_title"`
	Duration       time.Duration `json:"video_duration"`
	ChannelID      string        `json:"channel_id"`
	ChannelName    string        `json:"channel_name"`
	ChannelHandle  string        `json:"channel_handle,omitempty"`
	Thumbnail      string        `json:"thumbnail"`
	LinkedChannels []string      `json:"linked_channels,omitempty"`
	LinkedVideos   []string      `json:"linked_videos,omitempty"`
	HashTags       []string      `json:"hashtags,omitempty"`
}

func GetVideoInfo

func GetVideoInfo(ctx context.Context, videoURL *url.URL, opts Options) (v *VideoInfo, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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