mangaworld

package module
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 16 Imported by: 0

README

mangaworld

GoDoc CircleCI

Package DiegoBrignoli/mangaworld implements many API that allow web scraping from the site Mangaworld.

It implements:

  • Getting information of manga and chapters.
  • Getting page url of chapters.
  • Getting trending manga and new releases.
  • Searching manga by creating queries and querying the site.
  • Downloading the chapters.


Install

With a correctly configured Go toolchain:

go get -u github.com/DiegoBrignoli/mangaworld

Examples

Let's start by creating a manga object and a chapter object.

func main() {
    
	//Creating manga object
	manga, err := mangaworld.NewManga("https://www.mangaworld.io/manga/395/citrus")
	if err != nil {
		log.Fatalln(err)
	}
	
	//Creating chapter object
	chapter, err := mangaworld.NewChapter("https://www.mangaworld.io/manga/1876/citrus-1/read/5fbbfab01c9bb544acdbbac0/1")
	if err != nil {
		log.Fatalln(err)
	}
	
}

We have seen how to create Manga type and Chapter type objects. There are other types of objects in the module that can be created in the same way. (See documentation)

Info

Now let's see how to fill objects by invoking methods and getting manga or chapter data.


    //Create object
    manga, _ := mangaworld.NewManga("https://www.mangaworld.io/manga/395/citrus")
    
    //Call getTitle method to get the title of manga
    err = manga.GetTitle()
    if err != nil {
        t.Error("Error to get title")
    }
    
    fmt.Println("TITLE:", manga.Title)
    fmt.Println("OBJECT:", manga)

Query

Queries are useful for searching for manga using different filters. Now let's see how they are created and how to apply some filters.

func main() {
    
    //Create query
    q := mangaworld.NewQuery()
    
    //Serch by name
    q.SetMangaName("yagate kimi ni naru")
	
}

You can also apply multiple filters at the same time.

func main() {
    
    //Create query
    q := mangaworld.NewQuery()

    //Name filter
    q.SetMangaName("citrus")
    
    //Genres filter
    q.SetGenres([]mangaworld.Genre{
    	mangaworld.Yuri, 
    	mangaworld.Shoujo_ai,
    })
    
    //Manga types filter
    q.SetMangaTypes([]mangaworld.Type{
    	mangaworld.Manga_type 
    })
    
    //Status fileter
    q.SetStatus([]State{ 
    	mangaworld.Finish 
    })
    
    //Year filter
    q.SetYears([]string{
    	"2012" 
    })
	
}

To start the query search

func main() {
    
    //Create query
    q := mangaworld.NewQuery()
    
    //Serch by name
    q.SetMangaName("yagate kimi ni naru")
    
    //Do the query
    mangas, err := q.Do
    if err != nil {
    	log.Fatalln(err)
    }
	
    for _, manga := range mangas {
        fmt.Println(manga.Url)	
    }
    
}
New Chapters Released

Another of the features made available by this module is to be able to get the latest chapters released. Let's see how to do it.

func main() {
	
	//Get last 2 new chapters
	chaptersNew, err := mangaworld.ChaptersNew(2)
	if err != nil {
	    log.Fatalln(err)
	}
	
	for _, chapterNew := range chaptersNew {
		
		err := chapterNew.GetChapter()
		if err != nil {
			log.Fatalln(err)
		}
		
		err = chapterNew.GetManga()
		if err != nil {
			log.Fatalln(err)
		}
	}
	
}
Download

We come to the part that will certainly interest you the most: downloading chapters.

func main() {
	
    //Create chapter
    chapter, err := mangaworld.NewChapter("https://www.mangaworld.cc/manga/1876/citrus-1/read/5fbbfab01c9bb544acdbbaac/1")
    if err != nil {
        t.Error(err)
    }

    //Download chapter in /home/<user>/new
    err = c.Download("/home/<user>/new")
    if err != nil {
    	log.Fatalln(err)
    }
    
}

License

MIT licensed. See the LICENSE file for details.

Documentation

Overview

Package to download manga and get related information from mangaworld.

Index

Constants

View Source
const UrlSearch = "https://www.mangaworld.io/archive?"

UrlSearch is base URL for query search.

View Source
const UrlSite = "https://www.mangaworld.io/"

UrlSite is base URL of site MangaWorld.

Variables

View Source
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 NewDefaultWebDriver

func NewDefaultWebDriver(url string) (selenium.WebDriver, 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

func NewChapter(urlChapter string) (*Chapter, error)

NewChapter is a chapter constructor.

func (*Chapter) Download

func (c *Chapter) Download(dest string) error

Download all pages of chapter in a folder defined by the dest parameter.

func (*Chapter) GetDateAdd

func (c *Chapter) GetDateAdd() error

Add the date added to the object.

func (*Chapter) GetKeywords

func (c *Chapter) GetKeywords() error

Add keywords to the object.

func (*Chapter) GetNumber

func (c *Chapter) GetNumber() error

Add number of chapter to the object.

func (*Chapter) GetPageNum

func (c *Chapter) GetPageNum() error

Add the number of pages of chapter to the object.

func (*Chapter) GetPageUrl

func (c *Chapter) GetPageUrl() error

Add urls chapter pages to the object.

func (*Chapter) GetVisual

func (c *Chapter) GetVisual() error

Add the visual of chapter to the object.

func (*Chapter) GetVisualToday

func (c *Chapter) GetVisualToday() error

Add the daily visual to the object.

func (*Chapter) GetVolume

func (c *Chapter) GetVolume() error

Add number of volume of chapter 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 Fansub

type Fansub struct {
	Name string
	Url  string
}

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

func (lm *ListManga) AddAnilistUrls() (err error)

AddAnilistUrls add the anilist url to the object Manga of the manga in the list.

func (*ListManga) AddAnimeworldUrls

func (lm *ListManga) AddAnimeworldUrls() (err error)

AddAnimeworldUrls add the animeworld url to the object Manga of the manga in the list.

func (*ListManga) AddArtists

func (lm *ListManga) AddArtists() (err error)

AddArtists add the artists to the object Manga of the manga in the list.

func (*ListManga) AddAuthors

func (lm *ListManga) AddAuthors() (err error)

AddGenres add the authors to the object Manga of the manga in the list.

func (*ListManga) AddChapters

func (lm *ListManga) AddChapters(start, end int) (err error)

AddChapters add the chapters to the object Manga of the manga in the list.

func (*ListManga) AddChaptersNum

func (lm *ListManga) AddChaptersNum() (err error)

AddChaptersNum add the chapters num to the object Manga of the manga in the list.

func (*ListManga) AddCoverUrls

func (lm *ListManga) AddCoverUrls() (err error)

AddCoverUrls add the cover url to the object Manga of the manga in the list.

func (*ListManga) AddFansubs

func (lm *ListManga) AddFansubs() (err error)

AddFansubs add the fansub to the object Manga of the manga in the list.

func (*ListManga) AddGenres

func (lm *ListManga) AddGenres() (err error)

AddGenres add the genres to the object Manga of the manga in the list.

func (*ListManga) AddKeywords

func (lm *ListManga) AddKeywords() (err error)

AddKeywords add the keywords to the object Manga of the manga in the list.

func (*ListManga) AddMangaUpdatesUrls

func (lm *ListManga) AddMangaUpdatesUrls() (err error)

AddMangaUpdatesUrls add the manga updates url to the object Manga of the manga in the list.

func (*ListManga) AddPlots

func (lm *ListManga) AddPlots() (err error)

AddPlots add the plot to the object Manga of the manga in the list.

func (*ListManga) AddRelations

func (lm *ListManga) AddRelations() (err error)

AddRelations add the relations to the object Manga of the manga in the list.

func (*ListManga) AddStates

func (lm *ListManga) AddStates() (err error)

AddStates add the state to the object Manga of the manga in the list.

func (*ListManga) AddTitles

func (lm *ListManga) AddTitles() (err error)

AddTitle add the title to the object Manga of the manga in the list.

func (*ListManga) AddTitlesAlternatives

func (lm *ListManga) AddTitlesAlternatives() (err error)

AddTitlesAlternatives add the alternative titles to the object Manga of the manga in the list.

func (*ListManga) AddTypes

func (lm *ListManga) AddTypes() (err error)

AddTypes add the type to the object Manga of the manga in the list.

func (*ListManga) AddVisuals

func (lm *ListManga) AddVisuals() (err error)

AddVisuals add the visual to the object Manga of the manga in the list.

func (*ListManga) AddVolumesNum

func (lm *ListManga) AddVolumesNum() (err error)

AddVolumsNum add the volume num to the object Manga of the manga in the list.

func (*ListManga) AddYearsStart

func (lm *ListManga) AddYearsStart() (err error)

AddYearsStart add the year start to the object Manga of the manga in the list.

func (*ListManga) GetAlternativeTitles

func (lm *ListManga) GetAlternativeTitles() (altTitles [][]string)

GetAlternativeTitles returns a matrix of string with the alternative titles of manga in the list.

func (*ListManga) GetAnilistUrls

func (lm *ListManga) GetAnilistUrls() (anilistUrls []string)

GetAnilistUrls returns a slice of string with the anilist urls of manga in the list.

func (*ListManga) GetAnimeworldUrls

func (lm *ListManga) GetAnimeworldUrls() (animeUrls []string)

GetAnimeworldUrls returns a slice of string with the animeworld urls of manga in the list.

func (*ListManga) GetArtists

func (lm *ListManga) GetArtists() (artists [][]string)

GetArtists returns a matrix of string with the artists of manga in the list.

func (*ListManga) GetAuthors

func (lm *ListManga) GetAuthors() (authors [][]string)

GetAuthors returns a matrix of string with the authors of manga in the list.

func (*ListManga) GetChapters

func (lm *ListManga) GetChapters() (chapters [][]*Chapter)

GetChapters returns a matrix of Chapters with the chapters of manga in the list.

func (*ListManga) GetChaptersNum

func (lm *ListManga) GetChaptersNum() (numChapters []int)

GetChaptersNum returns a slice of int with the number of chapters of manga in the list.

func (*ListManga) GetCoverUrls

func (lm *ListManga) GetCoverUrls() (coverUrls []string)

GetCoverUrls returns a slice of string with the cover urls of manga in the list.

func (*ListManga) GetFansubs

func (lm *ListManga) GetFansubs() (fansubs []Fansub)

GetFansubs returns a slice of Fansub with the fansubs of manga in the list.

func (*ListManga) GetGenres

func (lm *ListManga) GetGenres() (genres [][]Genre)

GetGenres returns a matrix of Genre with the genres of manga in the list.

func (*ListManga) GetKeywords

func (lm *ListManga) GetKeywords() (keywords [][]string)

GetKeywords returns a matrix of string with the keywords of manga in the list.

func (*ListManga) GetMangaUpdatesUrls

func (lm *ListManga) GetMangaUpdatesUrls() (mangaUpUrls []string)

GetMangaUpdatesUrls returns a slice of string with the manga updates urls of manga in the list.

func (*ListManga) GetPlots

func (lm *ListManga) GetPlots() (plots []string)

GetPlots returns a slice of string with the plots of manga in the list.

func (*ListManga) GetStates

func (lm *ListManga) GetStates() (states []State)

GetStates returns a slice of State with the states of manga in the list.

func (*ListManga) GetTitles

func (lm *ListManga) GetTitles() (titles []string)

GetTitle returns a slice of string with the titles of manga in the list.

func (*ListManga) GetTypes

func (lm *ListManga) GetTypes() (types []Type)

GetTypes returns a slice of Type with the types of manga in the list.

func (*ListManga) GetUrls

func (lm *ListManga) GetUrls() (urls []string)

GetUrls returns a slice of string with the urls of manga in the list.

func (*ListManga) GetVisuals

func (lm *ListManga) GetVisuals() (visuals []int)

GetVisuals returns a slice of int with the number of visuals of manga in the list.

func (*ListManga) GetVolumsNum

func (lm *ListManga) GetVolumsNum() (numVolums []int)

GetVolumsNum returns a slice of int with the number of volums of manga in the list.

func (*ListManga) GetYearsStart

func (lm *ListManga) GetYearsStart() (years []string)

GetYearsStart returns a slice of string with the years start of manga in the list.

func (*ListManga) MonthlyManga

func (lm *ListManga) MonthlyManga() error

MonthlyManga add to the object a slice of manga with all the top 10 manga of the month.

func (*ListManga) SearchByGenre

func (lm *ListManga) SearchByGenre(genres []Genre) error

SearchByGenre is a query with only the manga genre. Add to the object ListManga a slice of Manga.

func (*ListManga) SearchByName

func (lm *ListManga) SearchByName(name string) error

SearchByName is a query with only the manga name. Add to the object ListManga a slice of Manga.

func (*ListManga) SearchByStatus

func (lm *ListManga) SearchByStatus(states []State) error

SearchByStatus is a query with only the manga status. Add to the object ListManga a slice of Manga.

func (*ListManga) SearchByType

func (lm *ListManga) SearchByType(types []Type) error

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 NewManga

func NewManga(urlManga string) (*Manga, error)

NewManga is the constructor of the manga object.

func (*Manga) Download

func (m *Manga) Download(dest string) error

Download all chapters in the object in a folder defined by the dest parameter.

func (*Manga) GetAlternativeTitle

func (m *Manga) GetAlternativeTitle() error

Add the alternative title to the object.

func (*Manga) GetAnilistUrl

func (m *Manga) GetAnilistUrl() error

Add anilist url to the object.

func (*Manga) GetAnimeworldUrl

func (m *Manga) GetAnimeworldUrl() error

Add animeworld url to the object.

func (*Manga) GetArtists

func (m *Manga) GetArtists() error

Add artist to the object.

func (*Manga) GetAuthors

func (m *Manga) GetAuthors() error

Add authors to the object.

func (*Manga) GetChapters

func (m *Manga) GetChapters(start int, end int) error

Add object Chapters (only url field value) to the object manga.

func (*Manga) GetChaptersNum

func (m *Manga) GetChaptersNum() error

Add number of chapters to the object.

func (*Manga) GetCoverUrl

func (m *Manga) GetCoverUrl() error

Add the cover url to the object.

func (*Manga) GetFansub

func (m *Manga) GetFansub() error

Add fansub to the object. TODO: Mettere apposto il fansub e altri poichè non è sempre in settima posizione

func (*Manga) GetGenre

func (m *Manga) GetGenre() error

Add the genres to the object.

func (*Manga) GetKeywords

func (m *Manga) GetKeywords() error

Add keywords to the object.

func (*Manga) GetMalUrl

func (m *Manga) GetMalUrl() error

Add My Anime List url to the object.

func (*Manga) GetMangaUpdatesUrl

func (m *Manga) GetMangaUpdatesUrl() error

Add manga updates url to the object.

func (*Manga) GetPlot

func (m *Manga) GetPlot() error

Add plot to the object.

func (*Manga) GetRelations

func (m *Manga) GetRelations() error

Add relation to the object.

func (*Manga) GetState

func (m *Manga) GetState() error

Add state to the object.

func (*Manga) GetTitle

func (m *Manga) GetTitle() error

Add the title to the object.

func (*Manga) GetType

func (m *Manga) GetType() error

Add type to the object.

func (*Manga) GetVisual

func (m *Manga) GetVisual() error

Add visual to the object.

func (*Manga) GetVolumsNum

func (m *Manga) GetVolumsNum() error

Add number of volumes to the object.

func (*Manga) GetYearsStart

func (m *Manga) GetYearsStart() error

Add start years 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 NewQuery

func NewQuery() *Query

NewQuery is a constructor of object Query.

func (*Query) Do

func (q *Query) Do() (mangas []*Manga, err error)

Executes the query that was previously set.

func (*Query) SetArtists

func (q *Query) SetArtists(artists []string)

Set manga artists value to the object.

func (*Query) SetAuthors

func (q *Query) SetAuthors(authors []string)

Set manga authors value to the object.

func (*Query) SetGenres

func (q *Query) SetGenres(genres []Genre)

Set manga genres value to the object.

func (*Query) SetMangaName

func (q *Query) SetMangaName(name string)

Set manga name value to the object.

func (*Query) SetMangaTypes

func (q *Query) SetMangaTypes(mangaTypes []Type)

Set manga types value to the object.

func (*Query) SetSort

func (q *Query) SetSort(method Sort)

Set sort result value to the object.

func (*Query) SetStatus

func (q *Query) SetStatus(states []State)

Set manga status value to the object.

func (*Query) SetYears

func (q *Query) SetYears(years []string)

Set manga years value to the object.

type ServiceConfig

type ServiceConfig struct {
	SeleniumPath    string
	GeckoDriverPath string
	Port            int
	Verbose         bool
	Output          io.Writer
}

type Sort

type Sort string

Sort is a type that defines the type of sorting in query results.

const (
	AZ       Sort = "a-z"
	ZA       Sort = "z-a"
	MostRead Sort = "most_read"
	LessRead Sort = "less_read"
	Newest   Sort = "newest"
	Oldest   Sort = "oldest"
)

type State

type State string

State is a type that defines the state of manga.

const (
	Deleted   State = "Cancellato"
	Dropped   State = "Droppato"
	Finish    State = "Finito"
	Paused    State = "In pausa"
	Releasing State = "In corso"
)
type Trending struct {
	Manga   Manga
	Chapter Chapter
	// contains filtered or unexported fields
}

Trending is a object that contains all the information of the manga in trending.

func NewTrendingManga

func NewTrendingManga(n *html.Node) (*Trending, error)

NewTrendingManga is a construct of Trending manga object.

func TrendingManga

func TrendingManga() (mangaTrend []Trending, err error)

TrendingManga returns a trending slice with all manga trending and relative chapter.

func (*Trending) GetChapter

func (t *Trending) GetChapter() error

Add object Chapter (only url field value) to the object.

func (*Trending) GetManga

func (t *Trending) GetManga() error

Add object Manga (only url field value) to the object.

type Type

type Type string

Type define the type of the manga.

const (
	Manga_type Type = "Manga"
	Manhua     Type = "Manhua"
	Manhwa     Type = "Manhwa"
	Oneshot    Type = "Oneshot"
	Thai       Type = "Thai"
	Vietnamese Type = "Vietnamese"
)

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

func NewVolume(VolumNode *html.Node) (*Volume, error)

NewVolume is a construct of volum object. You have to pass as a parameter the section dedicated to volumes on the manga page.

func (*Volume) GetChapters

func (v *Volume) GetChapters() error

Add object Chapter to the object.

func (*Volume) GetName

func (v *Volume) GetName() error

Add name value to the object. EX: "Volume 01".

func (*Volume) GetNumber

func (v *Volume) GetNumber() error

Add number of volume to the object.

type WebDriverConfig

type WebDriverConfig struct {
	Capabilities selenium.Capabilities
	UrlService   string
}

Jump to

Keyboard shortcuts

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