scraper

package
v4.3.6 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fetch

func Fetch(url string) (*http.Response, error)

Types

type Channel

type Channel struct {
	ID    string `json:"id"`
	Title string `json:"title"`
	URL   string `json:"url"`
}

type ScrapeOptions

type ScrapeOptions struct {
	All   bool
	Until time.Time
}

type Scraper

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

func New

func New(opts ...option.ClientOption) (*Scraper, error)

func (*Scraper) Scrape

func (s *Scraper) Scrape(channelID string, opts *ScrapeOptions) []*Video

type Thumbnail

type Thumbnail struct {
	Height int    `json:"height"`
	PreSrc string `json:"preSrc"`
	Src    string `json:"src"`
	Width  int    `json:"width"`
}

func NewThumbnail

func NewThumbnail(src string) (*Thumbnail, error)

type Video

type Video struct {
	Channel     *Channel   `json:"channel"`
	Duration    string     `json:"duration"`
	ID          string     `json:"id"`
	ObjectID    string     `json:"objectID"`
	PublishedAt int64      `json:"publishedAt"`
	Thumbnail   *Thumbnail `json:"thumbnail,omitempty"`
	Title       string     `json:"title"`
	URL         string     `json:"url"`
}

func NewVideo

func NewVideo(item *youtube.Video) *Video

Jump to

Keyboard shortcuts

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