crawler

package
v0.0.0-...-1e37d63 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	ID string `yaml:"id"`
}

Channel represents youtube channel schema.

type Configs

type Configs struct {
	Channels []Channel `yaml:"channels"`
	Teams    []string  `yaml:"teams"`
	Terms    []string  `yaml:"terms"`
	Excludes []string  `yaml:"excludes"`
	Playlist string    `yaml:"playlist"`
}

Configs is the config file for the crawler.

type Crawler

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

Crawler crawls youtube channels and filters uploads that match the requirements.

func NewCrawler

func NewCrawler(configs *Configs, service *youtube.Service) *Crawler

NewCrawler Creates a new crawler object.

func (*Crawler) GetPlaylistID

func (c *Crawler) GetPlaylistID(channelID string) (string, error)

GetPlaylistID gets uploads ID.

func (*Crawler) GetUpdatedVideos

func (c *Crawler) GetUpdatedVideos() []*Video

GetUpdatedVideos returns a list of updated videos.

func (*Crawler) GetUploads

func (c *Crawler) GetUploads(playlistID string) ([]*Video, error)

GetUploads gets the uploaded videos for the given playlist.

func (*Crawler) Run

func (c *Crawler) Run()

Run runs the crawler.

type Video

type Video struct {
	ID           string `json:"id"`
	Title        string `json:"title"`
	ChannelTitle string `json:"channel_title"`
}

Video represents a simple video object.

Jump to

Keyboard shortcuts

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