service

package
v0.0.0-...-34674f1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDownloadFailed = errors.New("download failed")
)

Functions

func Captions

func Captions(videoId string) (captions []*youtube.Caption, err error)

func Download

func Download(url string, options ...ReqOptions) (resp *http.Response, err error)

func DownloadAndMergeCaption

func DownloadAndMergeCaption(videoId, mainId, mainTlang, secondaryId, secondaryTlang string) (path string, err error)

download two captions and merge them. return the filepath in local fs.

func DownloadCaption

func DownloadCaption(videoId string, captionId string, tlang string) (fpath string, err error)

Download caption and return it's path in local filesystem.

func DownloadInfo

func DownloadInfo(videoId string, no int, kind string) (fileName, url string, err error)

func DownloadToLocalFile

func DownloadToLocalFile(reader io.Reader, fileName string) (path string, err error)

func InsertComment

func InsertComment(nick string, content string, addr string) (err error)

func ListComment

func ListComment(pageNo, pageSize string) (comments []*model.Comment, err error)

func SetDownloadPath

func SetDownloadPath(path string)

func Video

func Video(videoUrl string) (video *model.Video, err error)

func VideoInfo

func VideoInfo(videoId string, kind string) (video *model.Video, err error)

Types

type ReqOptions

type ReqOptions func(r *http.Request)

Jump to

Keyboard shortcuts

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