search

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterResultType

func RegisterResultType(r Result)

func ResultTypeName

func ResultTypeName(r Result) string

Types

type Engine

type Engine interface {
	Search(q string, page int) ([]Result, error)
	Page(url string) ([]Result, error)
}

type Format

type Format struct {
	Resolution    string
	VideoEncoding string
	AudioEncoding string
	AudioBitrate  int
}

type Info

type Info interface {
	ID() string
	PageURL() *url.URL
	Title() string
	Created() time.Time
	Formats() []*Format
	Author() string
	Duration() time.Duration
}

type Result

type Result interface {
	ID() string

	IsPlayList() bool
	PlaylistResults(timeout time.Duration) ([]Result, error)

	DownloadURLs() (URLs, error)
	PageURL() *url.URL

	Title() string
	Info() (Info, error)
	Marshal() (string, error)
	Unmarshal(b string) error
}

func ResultType

func ResultType(name string) Result

type URLs

type URLs []*url.URL

func (URLs) Find

func (urls URLs) Find(maxURLsToTry int) (*url.URL, error)

type Youtube

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

func NewYoutube

func NewYoutube(timeout time.Duration) (*Youtube, error)

func (*Youtube) Page

func (y *Youtube) Page(channel string) ([]Result, error)

func (*Youtube) Search

func (y *Youtube) Search(q string, page int) ([]Result, error)

type YoutubeInfo

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

func (*YoutubeInfo) Author

func (y *YoutubeInfo) Author() string

func (*YoutubeInfo) Created

func (y *YoutubeInfo) Created() time.Time

func (*YoutubeInfo) Duration

func (y *YoutubeInfo) Duration() time.Duration

func (*YoutubeInfo) Formats

func (y *YoutubeInfo) Formats() []*Format

func (*YoutubeInfo) ID

func (y *YoutubeInfo) ID() string

func (*YoutubeInfo) PageURL

func (y *YoutubeInfo) PageURL() *url.URL

func (*YoutubeInfo) Title

func (y *YoutubeInfo) Title() string

type YoutubeResult

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

func (*YoutubeResult) DownloadURLs

func (y *YoutubeResult) DownloadURLs() (URLs, error)

func (*YoutubeResult) ID

func (y *YoutubeResult) ID() string

func (*YoutubeResult) Info

func (y *YoutubeResult) Info() (Info, error)

func (*YoutubeResult) IsPlayList

func (y *YoutubeResult) IsPlayList() bool

func (*YoutubeResult) Marshal

func (y *YoutubeResult) Marshal() (string, error)

func (*YoutubeResult) PageURL

func (y *YoutubeResult) PageURL() *url.URL

func (*YoutubeResult) PlaylistResults

func (y *YoutubeResult) PlaylistResults(timeout time.Duration) ([]Result, error)

func (*YoutubeResult) Title

func (y *YoutubeResult) Title() string

func (*YoutubeResult) Unmarshal

func (y *YoutubeResult) Unmarshal(b string) error

Jump to

Keyboard shortcuts

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