feed

package
v0.0.0-...-8dea4bf Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(_ctx context.Context, feed *model.Feed, cfg *Config, hostname string) (*itunes.Podcast, error)

func BuildOPML

func BuildOPML(ctx context.Context, feeds map[string]*Config, db feedProvider, hostname string) (string, error)

func EnclosureFromExtension

func EnclosureFromExtension(feedConfig *Config) itunes.EnclosureType

func EpisodeName

func EpisodeName(feedConfig *Config, episode *model.Episode) string

Types

type Cleanup

type Cleanup struct {
	// KeepLast defines how many episodes to keep
	KeepLast int `toml:"keep_last"`
}

type Config

type Config struct {
	ID string `toml:"-"`
	// URL is a full URL of the field
	URL string `toml:"url"`
	// PageSize is the number of pages to query from YouTube API.
	// NOTE: larger page sizes/often requests might drain your API token.
	PageSize int `toml:"page_size"`
	// UpdatePeriod is how often to check for updates.
	// Format is "300ms", "1.5h" or "2h45m".
	// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
	// NOTE: too often update check might drain your API token.
	UpdatePeriod time.Duration `toml:"update_period"`
	// Cron expression format is how often to check update
	// NOTE: too often update check might drain your API token.
	CronSchedule string `toml:"cron_schedule"`
	// Quality to use for this feed
	Quality model.Quality `toml:"quality"`
	// Maximum height of video
	MaxHeight int `toml:"max_height"`
	// Format to use for this feed
	Format model.Format `toml:"format"`
	// Custom format properties
	CustomFormat CustomFormat `toml:"custom_format"`
	// Only download episodes that match the filters (defaults to matching anything)
	Filters Filters `toml:"filters"`
	// Clean is a cleanup policy to use for this feed
	Clean Cleanup `toml:"clean"`
	// Custom is a list of feed customizations
	Custom Custom `toml:"custom"`
	// List of additional youtube-dl arguments passed at download time
	YouTubeDLArgs []string `toml:"youtube_dl_args"`
	// Included in OPML file
	OPML bool `toml:"opml"`
	// Private feed (not indexed by podcast aggregators)
	PrivateFeed bool `toml:"private_feed"`
	// Playlist sort
	PlaylistSort model.Sorting `toml:"playlist_sort"`
}

Config is a configuration for a feed loaded from TOML

type Custom

type Custom struct {
	CoverArt        string        `toml:"cover_art"`
	CoverArtQuality model.Quality `toml:"cover_art_quality"`
	Category        string        `toml:"category"`
	Subcategories   []string      `toml:"subcategories"`
	Explicit        bool          `toml:"explicit"`
	Language        string        `toml:"lang"`
	Author          string        `toml:"author"`
	Title           string        `toml:"title"`
	Description     string        `toml:"description"`
	OwnerName       string        `toml:"ownerName"`
	OwnerEmail      string        `toml:"ownerEmail"`
	Link            string        `toml:"link"`
}

type CustomFormat

type CustomFormat struct {
	YouTubeDLFormat string `toml:"youtube_dl_format"`
	Extension       string `toml:"extension"`
}

type Filters

type Filters struct {
	Title          string `toml:"title"`
	NotTitle       string `toml:"not_title"`
	Description    string `toml:"description"`
	NotDescription string `toml:"not_description"`
	MinDuration    int64  `toml:"min_duration"`
	MaxDuration    int64  `toml:"max_duration"`
	MaxAge         int    `toml:"max_age"`
}

type FixedKeyProvider

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

func (FixedKeyProvider) Get

func (p FixedKeyProvider) Get() string

type KeyProvider

type KeyProvider interface {
	Get() string
}

func NewFixedKey

func NewFixedKey(key string) (KeyProvider, error)

func NewKeyProvider

func NewKeyProvider(keys []string) (KeyProvider, error)

func NewRotatedKeys

func NewRotatedKeys(keys []string) (KeyProvider, error)

type RotatedKeyProvider

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

func (*RotatedKeyProvider) Get

func (p *RotatedKeyProvider) Get() string

Jump to

Keyboard shortcuts

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