Documentation
¶
Index ¶
- type Chapter
- type Enumerable
- type Filterable
- type Filterables
- type Grabber
- func (g Grabber) BaseURL() string
- func (g Grabber) GetFilenameTemplate() string
- func (g Grabber) GetMaxConcurrency() MaxConcurrency
- func (g Grabber) GetPreferredLanguage() string
- func (g *Grabber) IdentifySite() (Site, []error)
- func (g *Grabber) InitFlags(cmd *cobra.Command)
- func (g *Grabber) SetMaxConcurrency(m MaxConcurrency)
- type Inmanga
- type InmangaChapter
- type Mangadex
- type MangadexChapter
- type MaxConcurrency
- type Page
- type PlainHTML
- type PlainHTMLChapter
- type Settings
- type Site
- type SiteSelector
- type Tcb
- type TcbChapter
- type Titleable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chapter ¶
Chapter represents a manga chapter
type Enumerable ¶
type Enumerable interface {
GetNumber() float64
}
Enumerable represents an object that can be enumerated
type Filterable ¶
type Filterable interface { Enumerable Titleable }
Filterable represents an filterable objects
type Filterables ¶
type Filterables []Filterable
Filterables represents a slice of Filterable
func (Filterables) Filter ¶
func (f Filterables) Filter(cond func(Filterable) bool) Filterables
Filter allows to filter Filterables by the given condition
func (Filterables) FilterRanges ¶
func (f Filterables) FilterRanges(rngs []ranges.Range) Filterables
FilterRanges returns the specified ranges of Filterables sorted by their Number
func (Filterables) SortByNumber ¶
func (f Filterables) SortByNumber() Filterables
SortByNumber sorts Filterables by Number
type Grabber ¶
type Grabber struct { // URL is the manga index URL URL string // Settings are the grabber settings Settings *Settings }
Grabber is the base struct for all grabbers/sites
func (Grabber) GetFilenameTemplate ¶
GetFilenameTemplate returns the defined filename template
func (Grabber) GetMaxConcurrency ¶
func (g Grabber) GetMaxConcurrency() MaxConcurrency
GetMaxConcurrency returns the max concurrency for the site
func (Grabber) GetPreferredLanguage ¶
GetPreferredLanguage returns the preferred language for the site
func (*Grabber) IdentifySite ¶
IdentifySite returns the site passing the ValidateURL() for the specified url
func (*Grabber) SetMaxConcurrency ¶
func (g *Grabber) SetMaxConcurrency(m MaxConcurrency)
SetMaxConcurrency sets the max concurrency for the site
type Inmanga ¶
type Inmanga struct { *Grabber // contains filtered or unexported fields }
Inmanga is a grabber for inmanga.com
func (Inmanga) FetchChapter ¶
func (i Inmanga) FetchChapter(chap Filterable) (*Chapter, error)
FetchChapter fetches the chapter with its pages
func (Inmanga) FetchChapters ¶
func (i Inmanga) FetchChapters() (Filterables, error)
FetchChapters returns the chapters of the manga
func (*Inmanga) FetchTitle ¶
GetTitle fetches the manga title
func (*Inmanga) ValidateURL ¶
ValidateURL checks if the site is InManga
type InmangaChapter ¶
InmangaChapter is a chapter representation from InManga
type Mangadex ¶
type Mangadex struct { *Grabber // contains filtered or unexported fields }
Mangadex is a grabber for mangadex.org
func (Mangadex) FetchChapter ¶
func (m Mangadex) FetchChapter(f Filterable) (*Chapter, error)
FetchChapter fetches a chapter and its pages
func (Mangadex) FetchChapters ¶
func (m Mangadex) FetchChapters() (Filterables, error)
FetchChapters returns the chapters of the manga
func (*Mangadex) FetchTitle ¶
FetchTitle returns the title of the manga
func (*Mangadex) ValidateURL ¶
ValidateURL checks if the site is MangaDex
type MangadexChapter ¶
MangadexChapter represents a MangaDex Chapter
type MaxConcurrency ¶
type MaxConcurrency struct { // Chapters is the max concurrency for chapters Chapters uint8 // Pages is the max concurrency for pages Pages uint8 }
MaxConcurrency is the max concurrency for a site
type PlainHTML ¶
type PlainHTML struct { *Grabber // contains filtered or unexported fields }
PlainHTML is a grabber for any plain HTML page (with no ajax pagination whatsoever)
func (PlainHTML) FetchChapter ¶
func (m PlainHTML) FetchChapter(f Filterable) (*Chapter, error)
FetchChapter fetches a chapter and its pages
func (PlainHTML) FetchChapters ¶
func (m PlainHTML) FetchChapters() (Filterables, error)
FetchChapters returns a slice of chapters
func (PlainHTML) FetchTitle ¶
Ttitle returns the manga title
func (*PlainHTML) ValidateURL ¶
ValidateURL returns true if the URL is a valid grabber URL
type PlainHTMLChapter ¶
PlainHTMLChapter represents a PlainHTML Chapter
type Settings ¶
type Settings struct { // Bundle is a flag to indicate if the chapters should be bundled into a single file Bundle bool // MaxConcurrency determines max download concurrency MaxConcurrency MaxConcurrency // Language is the preferred language for downloading chapters Language string // FilenameTemplate is the template for the filename FilenameTemplate string // Range is the range to be downloaded (in string, i.e. "1-10,23,45-50") Range string // OutputDir is the output directory for the downloaded files OutputDir string }
Settings are grabber settings
type Site ¶
type Site interface { // InitFlags initializes the command flags InitFlags(cmd *cobra.Command) // Test tests if the site is the one for the specified url ValidateURL() (bool, error) // FetchChapters fetches the chapters for the manga FetchChapters() (Filterables, error) // FetchChapter fetches the specified chapter FetchChapter(Filterable) (*Chapter, error) // FetchTitle fetches the manga title FetchTitle() (string, error) // BaseURL returns the base url of the site BaseURL() string // GetFilenameTemplate returns the filename template GetFilenameTemplate() string // GetMaxConcurrency returns the max concurrency for the site GetMaxConcurrency() MaxConcurrency // GetPreferredLanguage returns the preferred language for the site GetPreferredLanguage() string }
Site is the handler interface, base of all manga sites grabbers
type SiteSelector ¶
type Tcb ¶
type Tcb struct { *Grabber // contains filtered or unexported fields }
Tcb is a grabber for tcbscans.com (and possibly other wordpress sites)
func (Tcb) FetchChapter ¶
func (t Tcb) FetchChapter(f Filterable) (*Chapter, error)
FetchChapter fetches a chapter and its pages
func (Tcb) FetchChapters ¶
func (t Tcb) FetchChapters() (chapters Filterables, err error)
FetchChapters returns a slice of chapters
func (*Tcb) FetchTitle ¶
FetchTitle fetches and returns the manga title
func (*Tcb) ValidateURL ¶
ValidateURL returns true if the URL is a compatible TCBScans URL
type TcbChapter ¶
TcbChapter is a chapter for TCBScans