Documentation ¶
Overview ¶
Package youtube provides loading audio from video files for given youtube channels
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelService ¶
type ChannelService interface {
Get(ctx context.Context, chanID string, feedType ytfeed.Type) ([]ytfeed.Entry, error)
}
ChannelService is an interface for getting channel entries, i.e. the list of videos
type DownloaderService ¶
type DownloaderService interface {
Get(ctx context.Context, id string, fname string) (file string, err error)
}
DownloaderService is an interface for downloading audio from youtube
type DurationService ¶
DurationService is an interface for getting duration of audio file
type FeedFilter ¶
FeedFilter contains filter criteria for the feed
type FeedInfo ¶
type FeedInfo struct { Name string `yaml:"name"` ID string `yaml:"id"` Type ytfeed.Type `yaml:"type"` Keep int `yaml:"keep"` Language string `yaml:"lang"` Filter FeedFilter `yaml:"filter"` }
FeedInfo contains channel or feed ID, readable name and other per-feed info
type RSSFileStore ¶
RSSFileStore is a store for RSS feed files
func (*RSSFileStore) Save ¶
func (s *RSSFileStore) Save(chanID, rss string) error
Save RSS feed file to the FS
type Service ¶
type Service struct { Feeds []FeedInfo Downloader DownloaderService ChannelService ChannelService Store StoreService CheckDuration time.Duration RSSFileStore RSSFileStore DurationService DurationService KeepPerChannel int RootURL string SkipShorts time.Duration }
Service loads audio from youtube channels
func (*Service) Do ¶
Do is a blocking function that downloads audio from youtube channels and updates metadata
func (*Service) RemoveEntry ¶
RemoveEntry deleted entry from store. Doesn't removes file
type StoreService ¶
type StoreService interface { Save(entry ytfeed.Entry) (bool, error) Load(channelID string, max int) ([]ytfeed.Entry, error) Exist(entry ytfeed.Entry) (bool, error) RemoveOld(channelID string, keep int) ([]string, error) Remove(entry ytfeed.Entry) error SetProcessed(entry ytfeed.Entry) error ResetProcessed(entry ytfeed.Entry) error CheckProcessed(entry ytfeed.Entry) (found bool, ts time.Time, err error) CountProcessed() (count int) }
StoreService is an interface for storing and loading metadata about downloaded audio
Directories ¶
Path | Synopsis |
---|---|
Package feed provided parser and downloader for youtube feeds and entries.
|
Package feed provided parser and downloader for youtube feeds and entries. |
Package store provides a store for the youtube service metadata
|
Package store provides a store for the youtube service metadata |