downloader

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanPath

func CleanPath(path string) string

func DryRun added in v1.1.1

func DryRun() bool

func SetConfig added in v1.1.1

func SetConfig(cfg Config)

Types

type Config

type Config struct {
	DryRun            bool `yaml:"dryRun"`
	SimultaneousPages int  `yaml:"simultaneousPages"`
	PageRetries       int  `yaml:"pageRetries"`
	Delay             struct {
		Page          string
		Chapter       string
		UpdateChapter string `yaml:"updateChapter"`
	}
	Output struct {
		Path             string
		UpdatePath       string `yaml:"updatePath"`
		Zip              bool
		FilenameTemplate string `yaml:"filenameTemplate"`
	}
	Metadata struct {
		Agent    string
		Location string
	}
}

func (*Config) Default

func (c *Config) Default(inContainer bool)

type Downloader

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

func NewDownloader

func NewDownloader(updateMode bool,
	enforceChapterDuration bool) *Downloader

func (*Downloader) CanDownload

func (d *Downloader) CanDownload(chapter *manga.Chapter) *logging.ScraperError

func (*Downloader) Cleanup

func (d *Downloader) Cleanup(chapter *manga.Chapter) error

func (*Downloader) CreateDirectory

func (d *Downloader) CreateDirectory(title, downloadType string) string

func (*Downloader) Download

func (d *Downloader) Download(chapter *manga.Chapter) error

Download chapter. Assumes CanDownload() has been called and has returned true

func (*Downloader) DownloadPage added in v1.1.1

func (d *Downloader) DownloadPage(page *manga.Page) ([]byte, error)

func (*Downloader) GetChapterPath

func (d *Downloader) GetChapterPath(filename string) string

func (*Downloader) GetNameFromTemplate

func (d *Downloader) GetNameFromTemplate(chapter *manga.Chapter) string

func (*Downloader) MetadataAgent

func (d *Downloader) MetadataAgent() *metadata.Agent

func (*Downloader) SetChapterDuration

func (d *Downloader) SetChapterDuration(duration int64) *Downloader

func (*Downloader) SetMaxRuneCount added in v1.1.1

func (d *Downloader) SetMaxRuneCount(chapters []manga.Chapter) *Downloader

func (*Downloader) SetPath added in v1.1.1

func (d *Downloader) SetPath(path string) *Downloader

func (*Downloader) SetTemplate

func (d *Downloader) SetTemplate(template string) *Downloader

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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