Documentation
¶
Overview ¶
Package to download manga and get related information from mangaworld.
Index ¶
- Constants
- Variables
- func NewDefaultService() error
- func NewDefaultWebDriver(url string) (selenium.WebDriver, error)
- func NewService(cfg *ServiceConfig) (err error)
- func NewWebDriver(url string, cfg *WebDriverConfig) (selenium.WebDriver, error)
- func ServiceIsActive() bool
- type Chapter
- func (c *Chapter) Download(dest string) error
- func (c *Chapter) GetDateAdd() error
- func (c *Chapter) GetKeywords() error
- func (c *Chapter) GetNumber() error
- func (c *Chapter) GetPageNum() error
- func (c *Chapter) GetPageUrl() error
- func (c *Chapter) GetVisual() error
- func (c *Chapter) GetVisualToday() error
- func (c *Chapter) GetVolume() error
- type ChapterNew
- type Fansub
- type Genre
- type ListChapter
- func (lc *ListChapter) AddDateAdd() error
- func (lc *ListChapter) AddKeywords() error
- func (lc *ListChapter) AddNumVolumes() error
- func (lc *ListChapter) AddNumber() error
- func (lc *ListChapter) AddPageNums() error
- func (lc *ListChapter) AddPagesUrls() error
- func (lc *ListChapter) AddVisuals() error
- func (lc *ListChapter) AddVisualsToday() error
- func (lc *ListChapter) GetDatesAdd() (dates []time.Time)
- func (lc *ListChapter) GetKeywords() (keywords [][]string)
- func (lc *ListChapter) GetNumVolumes() (numVolumes []int)
- func (lc *ListChapter) GetNumber() (numbers []string)
- func (lc *ListChapter) GetPageNums() (pageNumbers []int)
- func (lc *ListChapter) GetPagesUrls() (pagesUrls [][]string)
- func (lc *ListChapter) GetUrls() (urls []string)
- func (lc *ListChapter) GetVisuals() (visuals []int)
- func (lc *ListChapter) GetVisualsToday() (dailyVisuals []int)
- type ListManga
- func (lm *ListManga) AddAnilistUrls() (err error)
- func (lm *ListManga) AddAnimeworldUrls() (err error)
- func (lm *ListManga) AddArtists() (err error)
- func (lm *ListManga) AddAuthors() (err error)
- func (lm *ListManga) AddChapters(start, end int) (err error)
- func (lm *ListManga) AddChaptersNum() (err error)
- func (lm *ListManga) AddCoverUrls() (err error)
- func (lm *ListManga) AddFansubs() (err error)
- func (lm *ListManga) AddGenres() (err error)
- func (lm *ListManga) AddKeywords() (err error)
- func (lm *ListManga) AddMangaUpdatesUrls() (err error)
- func (lm *ListManga) AddPlots() (err error)
- func (lm *ListManga) AddRelations() (err error)
- func (lm *ListManga) AddStates() (err error)
- func (lm *ListManga) AddTitles() (err error)
- func (lm *ListManga) AddTitlesAlternatives() (err error)
- func (lm *ListManga) AddTypes() (err error)
- func (lm *ListManga) AddVisuals() (err error)
- func (lm *ListManga) AddVolumesNum() (err error)
- func (lm *ListManga) AddYearsStart() (err error)
- func (lm *ListManga) GetAlternativeTitles() (altTitles [][]string)
- func (lm *ListManga) GetAnilistUrls() (anilistUrls []string)
- func (lm *ListManga) GetAnimeworldUrls() (animeUrls []string)
- func (lm *ListManga) GetArtists() (artists [][]string)
- func (lm *ListManga) GetAuthors() (authors [][]string)
- func (lm *ListManga) GetChapters() (chapters [][]*Chapter)
- func (lm *ListManga) GetChaptersNum() (numChapters []int)
- func (lm *ListManga) GetCoverUrls() (coverUrls []string)
- func (lm *ListManga) GetFansubs() (fansubs []Fansub)
- func (lm *ListManga) GetGenres() (genres [][]Genre)
- func (lm *ListManga) GetKeywords() (keywords [][]string)
- func (lm *ListManga) GetMangaUpdatesUrls() (mangaUpUrls []string)
- func (lm *ListManga) GetPlots() (plots []string)
- func (lm *ListManga) GetStates() (states []State)
- func (lm *ListManga) GetTitles() (titles []string)
- func (lm *ListManga) GetTypes() (types []Type)
- func (lm *ListManga) GetUrls() (urls []string)
- func (lm *ListManga) GetVisuals() (visuals []int)
- func (lm *ListManga) GetVolumsNum() (numVolums []int)
- func (lm *ListManga) GetYearsStart() (years []string)
- func (lm *ListManga) MonthlyManga() error
- func (lm *ListManga) SearchByGenre(genres []Genre) error
- func (lm *ListManga) SearchByName(name string) error
- func (lm *ListManga) SearchByStatus(states []State) error
- func (lm *ListManga) SearchByType(types []Type) error
- type Manga
- func (m *Manga) Download(dest string) error
- func (m *Manga) GetAlternativeTitle() error
- func (m *Manga) GetAnilistUrl() error
- func (m *Manga) GetAnimeworldUrl() error
- func (m *Manga) GetArtists() error
- func (m *Manga) GetAuthors() error
- func (m *Manga) GetChapters(start int, end int) error
- func (m *Manga) GetChaptersNum() error
- func (m *Manga) GetCoverUrl() error
- func (m *Manga) GetFansub() error
- func (m *Manga) GetGenre() error
- func (m *Manga) GetKeywords() error
- func (m *Manga) GetMalUrl() error
- func (m *Manga) GetMangaUpdatesUrl() error
- func (m *Manga) GetPlot() error
- func (m *Manga) GetRelations() error
- func (m *Manga) GetState() error
- func (m *Manga) GetTitle() error
- func (m *Manga) GetType() error
- func (m *Manga) GetVisual() error
- func (m *Manga) GetVolumsNum() error
- func (m *Manga) GetYearsStart() error
- type Query
- func (q *Query) Do() (mangas []*Manga, err error)
- func (q *Query) SetArtists(artists []string)
- func (q *Query) SetAuthors(authors []string)
- func (q *Query) SetGenres(genres []Genre)
- func (q *Query) SetMangaName(name string)
- func (q *Query) SetMangaTypes(mangaTypes []Type)
- func (q *Query) SetSort(method Sort)
- func (q *Query) SetStatus(states []State)
- func (q *Query) SetYears(years []string)
- type ServiceConfig
- type Sort
- type State
- type Trending
- type Type
- type Volume
- type WebDriverConfig
Constants ¶
const UrlSearch = "https://www.mangaworld.io/archive?"
UrlSearch is base URL for query search.
const UrlSite = "https://www.mangaworld.io/"
UrlSite is base URL of site MangaWorld.
Variables ¶
var MonthNames = map[string]int{
"Gennaio": 1,
"Febbraio": 2,
"Marzo": 3,
"Aprile": 4,
"Maggio": 5,
"Giugno": 6,
"Luglio": 7,
"Agosto": 8,
"Settembre": 9,
"Ottobre": 10,
"Novembre": 11,
"Dicembre": 12,
}
MonthNames is a map with the value int of italian months.
Functions ¶
func NewDefaultService ¶
func NewDefaultService() error
func NewService ¶
func NewService(cfg *ServiceConfig) (err error)
func NewWebDriver ¶
func NewWebDriver(url string, cfg *WebDriverConfig) (selenium.WebDriver, error)
func ServiceIsActive ¶
func ServiceIsActive() bool
Types ¶
type Chapter ¶
type Chapter struct { Url string Volume int Number string PageNum int Visual int VisualToday int PageUrl []string DateAdd time.Time KeyWords []string // contains filtered or unexported fields }
Chapter is an object with all chapters information.
func NewChapter ¶
NewChapter is a chapter constructor.
func (*Chapter) GetPageNum ¶
Add the number of pages of chapter to the object.
func (*Chapter) GetPageUrl ¶
Add urls chapter pages to the object.
func (*Chapter) GetVisualToday ¶
Add the daily visual to the object.
type ChapterNew ¶
type ChapterNew struct { MangaNew Manga Chapters []Chapter // contains filtered or unexported fields }
ChapterNew is an object of new chapters just released.
func ChaptersNew ¶
func ChaptersNew(num int) (chapters []ChapterNew, err error)
ChaptersNew returns a slice of chapters with the chapters just released. It accepts as a parameter the number of new manga you want to get.
func NewChapterNew ¶
func NewChapterNew(n *html.Node) (*ChapterNew, error)
NewChapterNew is a construct of ChapterNew object.
func (*ChapterNew) GetChapter ¶
func (cn *ChapterNew) GetChapter() error
Add object Chapter (only url field value) to the object.
func (*ChapterNew) GetManga ¶
func (cn *ChapterNew) GetManga() error
Add object Manga (only url field value) to the object.
type Genre ¶
type Genre string
Genre is the type that defines the genre of a manga.
const ( Action Genre = "Action" Adult Genre = "Adult" Adventure Genre = "Adventure" Comedy Genre = "Comedy" Doujinshi Genre = "Doujinshi" Drama Genre = "Drama" Ecchi Genre = "Ecchi" Fantasy Genre = "Fantasy" Gender_bender Genre = "Gender Bender" Harem Genre = "Harem" Hentai Genre = "Hentai" Historical Genre = "Historical" Horror Genre = "Horror" Josei Genre = "Josei" Lolicon Genre = "Lolicon" Martial_arts Genre = "Martial Arts" Mature Genre = "Mature" Mecha Genre = "Mecha" Mistery Genre = "Mistery" Psychological Genre = "Psychological" Romantic Genre = "Romantic" School Genre = "School" Sci_fi Genre = "Sci-fi" Seinen Genre = "Seinen" Shotacon Genre = "Shotacon" Shoujo Genre = "Shoujo" Shoujo_ai Genre = "Shoujo Ai" Shounen Genre = "Shounen" Shounen_ai Genre = "Shounen Ai" Slice_of_life Genre = "Slice of Life" Smut Genre = "Smut" Supernatural Genre = "Supernatural" Sport Genre = "Sport" Tragic Genre = "Tragic" Yaoi Genre = "Yaoi" Yuri Genre = "Yuri" )
type ListChapter ¶
type ListChapter struct {
Chapters []Chapter
}
func NewChapterList ¶
func NewChapterList() *ListChapter
NewChapterList is an constructor of ListChapter object.
func (*ListChapter) AddDateAdd ¶
func (lc *ListChapter) AddDateAdd() error
AddDateAdd add date of addition of chapters to the Chapter objects.
func (*ListChapter) AddKeywords ¶
func (lc *ListChapter) AddKeywords() error
AddKeywords add keywords of chapters to the Chapter objects.
func (*ListChapter) AddNumVolumes ¶
func (lc *ListChapter) AddNumVolumes() error
AddNumVolumes add number of volumes of chapters to the Chapter objects.
func (*ListChapter) AddNumber ¶
func (lc *ListChapter) AddNumber() error
AddNumber add numbers of chapters to the Chapter objects.
func (*ListChapter) AddPageNums ¶
func (lc *ListChapter) AddPageNums() error
AddPageNum add number of pages of chapters to the Chapter objects.
func (*ListChapter) AddPagesUrls ¶
func (lc *ListChapter) AddPagesUrls() error
AddPagesUrls add pages urls of chapters to the Chapter objects.
func (*ListChapter) AddVisuals ¶
func (lc *ListChapter) AddVisuals() error
AddVisual add number of visuals of chapters to the Chapter objects.
func (*ListChapter) AddVisualsToday ¶
func (lc *ListChapter) AddVisualsToday() error
AddVisualToday add number of daily visuals of chapters to the Chapter objects.
func (*ListChapter) GetDatesAdd ¶
func (lc *ListChapter) GetDatesAdd() (dates []time.Time)
GetDatesAdd returns a slice of time.Time with the dates add of the chapters contained in the ListChapter.
func (*ListChapter) GetKeywords ¶
func (lc *ListChapter) GetKeywords() (keywords [][]string)
GetKeywords returns a matrix of string with the keywords of the chapters contained in the ListChapter.
func (*ListChapter) GetNumVolumes ¶
func (lc *ListChapter) GetNumVolumes() (numVolumes []int)
GetNumVolumes returns a slice of int with number of volumes of the chapters contained in the ListChapter.
func (*ListChapter) GetNumber ¶
func (lc *ListChapter) GetNumber() (numbers []string)
GetUrls returns a slice of int with numbers of the chapters contained in the ListChapter.
func (*ListChapter) GetPageNums ¶
func (lc *ListChapter) GetPageNums() (pageNumbers []int)
GetPageNums returns a slice of int with pages numbers of the chapters contained in the ListChapter.
func (*ListChapter) GetPagesUrls ¶
func (lc *ListChapter) GetPagesUrls() (pagesUrls [][]string)
GetPagesUrls returns a matrix of string with pages urls of the chapters contained in the ListChapter.
func (*ListChapter) GetUrls ¶
func (lc *ListChapter) GetUrls() (urls []string)
GetUrls returns a slice of string with urls of the chapters contained in the ListChapter.
func (*ListChapter) GetVisuals ¶
func (lc *ListChapter) GetVisuals() (visuals []int)
GetVisuals returns a slice of int with visuals of the chapters contained in the ListChapter.
func (*ListChapter) GetVisualsToday ¶
func (lc *ListChapter) GetVisualsToday() (dailyVisuals []int)
GetVisualsToday returns a slice of int with daily visuals of the chapters contained in the ListChapter.
type ListManga ¶
type ListManga struct {
Mangas []*Manga
}
ListManga is a type that contain a slice of manga
func NewListManga ¶
func NewListManga() *ListManga
NewListManga is an constructor of ListManga object
func (*ListManga) AddAnilistUrls ¶
AddAnilistUrls add the anilist url to the object Manga of the manga in the list.
func (*ListManga) AddAnimeworldUrls ¶
AddAnimeworldUrls add the animeworld url to the object Manga of the manga in the list.
func (*ListManga) AddArtists ¶
AddArtists add the artists to the object Manga of the manga in the list.
func (*ListManga) AddAuthors ¶
AddGenres add the authors to the object Manga of the manga in the list.
func (*ListManga) AddChapters ¶
AddChapters add the chapters to the object Manga of the manga in the list.
func (*ListManga) AddChaptersNum ¶
AddChaptersNum add the chapters num to the object Manga of the manga in the list.
func (*ListManga) AddCoverUrls ¶
AddCoverUrls add the cover url to the object Manga of the manga in the list.
func (*ListManga) AddFansubs ¶
AddFansubs add the fansub to the object Manga of the manga in the list.
func (*ListManga) AddGenres ¶
AddGenres add the genres to the object Manga of the manga in the list.
func (*ListManga) AddKeywords ¶
AddKeywords add the keywords to the object Manga of the manga in the list.
func (*ListManga) AddMangaUpdatesUrls ¶
AddMangaUpdatesUrls add the manga updates url to the object Manga of the manga in the list.
func (*ListManga) AddRelations ¶
AddRelations add the relations to the object Manga of the manga in the list.
func (*ListManga) AddTitlesAlternatives ¶
AddTitlesAlternatives add the alternative titles to the object Manga of the manga in the list.
func (*ListManga) AddVisuals ¶
AddVisuals add the visual to the object Manga of the manga in the list.
func (*ListManga) AddVolumesNum ¶
AddVolumsNum add the volume num to the object Manga of the manga in the list.
func (*ListManga) AddYearsStart ¶
AddYearsStart add the year start to the object Manga of the manga in the list.
func (*ListManga) GetAlternativeTitles ¶
GetAlternativeTitles returns a matrix of string with the alternative titles of manga in the list.
func (*ListManga) GetAnilistUrls ¶
GetAnilistUrls returns a slice of string with the anilist urls of manga in the list.
func (*ListManga) GetAnimeworldUrls ¶
GetAnimeworldUrls returns a slice of string with the animeworld urls of manga in the list.
func (*ListManga) GetArtists ¶
GetArtists returns a matrix of string with the artists of manga in the list.
func (*ListManga) GetAuthors ¶
GetAuthors returns a matrix of string with the authors of manga in the list.
func (*ListManga) GetChapters ¶
GetChapters returns a matrix of Chapters with the chapters of manga in the list.
func (*ListManga) GetChaptersNum ¶
GetChaptersNum returns a slice of int with the number of chapters of manga in the list.
func (*ListManga) GetCoverUrls ¶
GetCoverUrls returns a slice of string with the cover urls of manga in the list.
func (*ListManga) GetFansubs ¶
GetFansubs returns a slice of Fansub with the fansubs of manga in the list.
func (*ListManga) GetGenres ¶
GetGenres returns a matrix of Genre with the genres of manga in the list.
func (*ListManga) GetKeywords ¶
GetKeywords returns a matrix of string with the keywords of manga in the list.
func (*ListManga) GetMangaUpdatesUrls ¶
GetMangaUpdatesUrls returns a slice of string with the manga updates urls of manga in the list.
func (*ListManga) GetPlots ¶
GetPlots returns a slice of string with the plots of manga in the list.
func (*ListManga) GetStates ¶
GetStates returns a slice of State with the states of manga in the list.
func (*ListManga) GetTitles ¶
GetTitle returns a slice of string with the titles of manga in the list.
func (*ListManga) GetVisuals ¶
GetVisuals returns a slice of int with the number of visuals of manga in the list.
func (*ListManga) GetVolumsNum ¶
GetVolumsNum returns a slice of int with the number of volums of manga in the list.
func (*ListManga) GetYearsStart ¶
GetYearsStart returns a slice of string with the years start of manga in the list.
func (*ListManga) MonthlyManga ¶
MonthlyManga add to the object a slice of manga with all the top 10 manga of the month.
func (*ListManga) SearchByGenre ¶
SearchByGenre is a query with only the manga genre. Add to the object ListManga a slice of Manga.
func (*ListManga) SearchByName ¶
SearchByName is a query with only the manga name. Add to the object ListManga a slice of Manga.
func (*ListManga) SearchByStatus ¶
SearchByStatus is a query with only the manga status. Add to the object ListManga a slice of Manga.
func (*ListManga) SearchByType ¶
SearchByType is a query with only the manga type. Add to the object ListManga a slice of Manga.
type Manga ¶
type Manga struct { Url string Title string TitleAlternative []string CoverUrl string Genres []Genre Authors []string Artists []string Type Type State State Plot string YearsStart string VolumsNum int ChaptersNum int Chapters []*Chapter Relations []Manga Visual int Fansub Fansub AnimeworldUrl string AnilistUrl string MALUrl string MangaUpdatesUrl string Keywords []string // contains filtered or unexported fields }
Manga is a structure containing all information relating to the manga and its chapters.
func (*Manga) Download ¶
Download all chapters in the object in a folder defined by the dest parameter.
func (*Manga) GetAlternativeTitle ¶
Add the alternative title to the object.
func (*Manga) GetAnimeworldUrl ¶
Add animeworld url to the object.
func (*Manga) GetChapters ¶
Add object Chapters (only url field value) to the object manga.
func (*Manga) GetChaptersNum ¶
Add number of chapters to the object.
func (*Manga) GetFansub ¶
Add fansub to the object. TODO: Mettere apposto il fansub e altri poichè non è sempre in settima posizione
func (*Manga) GetMangaUpdatesUrl ¶
Add manga updates url to the object.
func (*Manga) GetVolumsNum ¶
Add number of volumes to the object.
type Query ¶
type Query struct { MangaName struct { Val string Active bool } Genre struct { Val []Genre Active bool } MangaType struct { Val []Type Active bool } State struct { Val []State Active bool } Author struct { Val []string Active bool } Artist struct { Val []string Active bool } Year struct { Val []string Active bool } SortType Sort }
Query is an object query that allows you to build your own personalized search.
func (*Query) SetArtists ¶
Set manga artists value to the object.
func (*Query) SetAuthors ¶
Set manga authors value to the object.
func (*Query) SetMangaName ¶
Set manga name value to the object.
func (*Query) SetMangaTypes ¶
Set manga types value to the object.
type ServiceConfig ¶
type Trending ¶
Trending is a object that contains all the information of the manga in trending.
func NewTrendingManga ¶
NewTrendingManga is a construct of Trending manga object.
func TrendingManga ¶
TrendingManga returns a trending slice with all manga trending and relative chapter.
func (*Trending) GetChapter ¶
Add object Chapter (only url field value) to the object.
type Volume ¶
type Volume struct { Number int Name string Chapters []Chapter // contains filtered or unexported fields }
Volume is a object with all volum information.
func NewVolume ¶
NewVolume is a construct of volum object. You have to pass as a parameter the section dedicated to volumes on the manga page.
type WebDriverConfig ¶
type WebDriverConfig struct { Capabilities selenium.Capabilities UrlService string }