mangapill

package
v0.16.5 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = &scraper.Configuration{
	Name:            Info.ID,
	Delay:           50 * time.Millisecond,
	ReverseChapters: true,
	BaseURL:         Info.Website,
	GenerateSearchURL: func(baseUrl string, query string) (string, error) {

		params := url.Values{}
		params.Set("q", query)
		params.Set("type", "")
		params.Set("status", "")

		u, _ := url.Parse(baseUrl)
		u.Path = "/search"
		u.RawQuery = params.Encode()

		return u.String(), nil
	},
	GenerateSearchByIDURL: func(baseUrl string, id string) (string, error) {
		return fmt.Sprintf("%smanga/%s", baseUrl, id), nil
	},
	MangaByIDExtractor: &scraper.MangaByIDExtractor{
		Selector: "div.container > div.flex.flex-col.sm\\:flex-row.my-3",
		Title: func(selection *goquery.Selection) string {
			return selection.Find("div.flex.flex-col > div.mb-3 > h1").Text()
		},
		Cover: func(selection *goquery.Selection) string {
			return selection.Find("div.text-transparent > img").AttrOr("data-src", "")
		},
	},
	MangaExtractor: &scraper.MangaExtractor{
		Selector: "body > div.container.py-3 > div.my-3.grid.justify-end.gap-3.grid-cols-2.md\\:grid-cols-3.lg\\:grid-cols-5 > div",
		Title: func(selection *goquery.Selection) string {
			return selection.Find("div a div.leading-tight").Text()
		},
		URL: func(selection *goquery.Selection) string {
			return selection.Find("div a:first-child").AttrOr("href", "")
		},
		Cover: func(selection *goquery.Selection) string {
			return selection.Find("img").AttrOr("data-src", "")
		},

		ID: func(_url string) string {
			return strings.Join(strings.Split(_url, "/")[4:], "/")
		},
	},
	VolumeExtractor: &scraper.VolumeExtractor{

		Selector: "body > div.container > div.border.border-border.rounded > div.p-3.border-b.border-border > div.flex.flex-col.md\\:flex-row.md\\:items-center.md\\:justify-between",
		Number: func(selection *goquery.Selection) float32 {
			return 1.0
		},
	},
	ChapterExtractor: &scraper.ChapterExtractor{
		Selector: "div[data-filter-list] a",
		Title: func(selection *goquery.Selection) string {
			return selection.Text()
		},
		URL: func(selection *goquery.Selection) string {
			return selection.AttrOr("href", "")
		},

		ID: func(_url string) string {
			return strings.Join(strings.Split(_url, "/")[4:], "/")
		},
		Date: func(_ *goquery.Selection) metadata.Date {

			today := time.Now()
			return metadata.Date{
				Year:  today.Year(),
				Month: int(today.Month()),
				Day:   today.Day(),
			}
		},
		ScanlationGroup: func(_ *goquery.Selection) string {
			return Info.Name
		},
	},
	PageExtractor: &scraper.PageExtractor{
		Selector: "picture img",
		URL: func(selection *goquery.Selection) string {
			return selection.AttrOr("data-src", "")
		},
	},
}
View Source
var Info = libmangal.ProviderInfo{
	ID:          mango.BundleID + "-mangapill",
	Name:        "Mangapill",
	Version:     "0.4.0",
	Description: "Mangapill scraper",
	Website:     "https://mangapill.com/",
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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