webtoon

package
v0.0.0-...-bd23c5e Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Domain      = "https://www.webtoons.com"
	BaseUrl     = "https://www.webtoons.com/en/"
	SearchUrl   = BaseUrl + "search?keyword=%s"
	ImagePrefix = "https://webtoon-phinf.pstatic.net/"
	EpisodeList = Domain + "/episodeList?titleNo=%s"
)

Variables

View Source
var (
	ErrMissingSource = errors.New("not all img had a source")
)

Functions

func New

func New(scope *dig.Scope) core.Downloadable

Types

type Builder

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

func NewBuilder

func NewBuilder(log zerolog.Logger, ps core.Client, repository Repository) *Builder

func (*Builder) Client

func (b *Builder) Client() services.Client

func (*Builder) DownloadMetadata

func (b *Builder) DownloadMetadata() payload.DownloadMetadata

func (*Builder) Logger

func (b *Builder) Logger() zerolog.Logger

func (*Builder) Normalize

func (b *Builder) Normalize(webtoons []SearchData) []payload.Info

func (*Builder) Provider

func (b *Builder) Provider() models.Provider

func (*Builder) Search

func (b *Builder) Search(s SearchOptions) ([]SearchData, error)

func (*Builder) Transform

func (b *Builder) Transform(s payload.SearchRequest) SearchOptions

type Chapter

type Chapter struct {
	Url      string
	ImageUrl string
	Title    string
	Number   string
	Date     string
}

func (Chapter) GetChapter

func (c Chapter) GetChapter() string

func (Chapter) GetId

func (c Chapter) GetId() string

func (Chapter) GetTitle

func (c Chapter) GetTitle() string

func (Chapter) GetVolume

func (c Chapter) GetVolume() string

type Repository

type Repository interface {
	Search(ctx context.Context, options SearchOptions) ([]SearchData, error)
	LoadImages(ctx context.Context, chapter Chapter) ([]string, error)
	SeriesInfo(ctx context.Context, id string) (*Series, error)
}

func NewRepository

func NewRepository(httpClient *menou.Client, log zerolog.Logger) Repository

type SearchData

type SearchData struct {
	Id              string   `json:"titleNo"`
	Name            string   `json:"title"`
	ReadCount       string   `json:"readCount"`
	ThumbnailMobile string   `json:"thumbnailMobile"`
	AuthorNameList  []string `json:"authorNameList"`
	Genre           string   `json:"representGenre"`
	Rating          bool     `json:"titleUnsuitableForChildren"`
}

func (*SearchData) ComicInfoRating

func (s *SearchData) ComicInfoRating() comicinfo.AgeRating

func (*SearchData) ProxiedImage

func (s *SearchData) ProxiedImage() string

func (*SearchData) Url

func (s *SearchData) Url() string

type SearchOptions

type SearchOptions struct {
	Query string
}

type Series

type Series struct {
	Id          string
	Name        string
	Authors     []string
	Description string
	Genre       string
	Completed   bool
	Chapters    []Chapter
}

func (*Series) AllChapters

func (s *Series) AllChapters() []Chapter

func (*Series) GetId

func (s *Series) GetId() string

func (*Series) GetTitle

func (s *Series) GetTitle() string

func (*Series) RefUrl

func (s *Series) RefUrl() string

Jump to

Keyboard shortcuts

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