Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result represents a youtube.com search result, i.e.: a youtube clip.
func FromURL ¶
FromURL parses the given url to extract the id and create a youtube result. see NewResult.
func NewResult ¶
NewResult creates a new youtube result. ID is required and should not be empty for it to be a valid youtube clip. Title is an arbitrary string that will be used as the title, this can be fetched using Title(id string) or Result.UpdateTitle().
func (*Result) DownloadURL ¶
DownloadURL asks youtube-dl to create a (temporary) download / stream url of the clip's contents.
func (*Result) UpdateTitle ¶
UpdateTitle uses Title to update the clips title using its id.
type Scraper ¶
type Scraper struct {
// contains filtered or unexported fields
}
Scraper is a wrapper around github.com/frizinak/libym/scraper to extract youtube Results.
func NewScraper ¶
NewScraper creates a new youtube url scraper with the given scraper. cb will be called with each match after a call to Scrape or ScrapeWithContext.
type ScraperCallback ¶
type ScraperCallback struct {
// contains filtered or unexported fields
}
ScraperCallback is the actual url matcher for Scraper which you probably want to use.
func NewScraperCallback ¶
func NewScraperCallback(cb func(*Result)) *ScraperCallback
NewScraperCallback creates a new ScraperCallback.