scraper

package
v0.0.0-...-f96d543 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BASE_URL           = "https://www.wenku8.net/book/"
	DEFAULT_USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36"
	SEARCH_URL         = "https://www.wenku8.net/modules/article/search.php"
	TOP_URL            = "https://www.wenku8.net/modules/article/toplist.php"
)

Variables

View Source
var (
	Cookie    string = ""
	UserAgent string = "" /* 139-byte string literal not displayed */
)

Functions

func AndroidGet

func AndroidGet(url string) (*goquery.Document, error)

func Get

func Get(url string) (*goquery.Document, error)

func GetChapterContent

func GetChapterContent(chapter *Chapter) error

func GetCookie

func GetCookie() error

Types

type Chapter

type Chapter struct {
	Index   int             `json:"index"`
	Title   string          `json:"title"`
	Url     string          `json:"url"`
	Content *ChapterContent `json:"content"`
}

func GetChapterArray

func GetChapterArray(volume *Volume) ([]*Chapter, error)

type ChapterContent

type ChapterContent struct {
	Article string   `json:"article"`
	Images  []string `json:"images"`
}

type CommandOptions

type CommandOptions struct {
	Epub       bool
	Ext        string
	OnlyImages bool
	OutDir     string
	Verbose    bool
	Strict     bool
}

type Novel

type Novel struct {
	NovelId        int    `json:"novel_id"`
	NovelName      string `json:"novel_name"`
	Cover          string `json:"cover"`
	Library        string `json:"library"`
	Author         string `json:"author"`
	Status         string `json:"status"`
	LastUpdateTime string `json:"last_update_time"`
	Length         string `json:"length"`
	Tag            string `json:"tag"`
	RecentChapter  string `json:"recent_chapter"`
	Desc           string `json:"desc"`
	CatalogueUrl   string `json:"catalogue_url"`
}

func GetNovelDetails

func GetNovelDetails(novelId int) (*Novel, error)

GetNovelDetails retrieves the novel details based on novelId

type PageResult

type PageResult struct {
	TotalPage  string   `json:"total_page"`
	NovelArray []*Novel `json:"result"`
}

func GetTop

func GetTop(topSoftType enums.TopSortType, page string) (*PageResult, error)
func Search(str string, searchType enums.SearchType, page string) (*PageResult, error)

type Volume

type Volume struct {
	Index        int    `json:"index"`
	Name         string `json:"name"`
	RowNumber    int    `json:"-"`
	EndRow       int    `json:"-"`
	CatalogueUrl string `json:"catalogue_url"`
	ChapterCount int    `json:"chapter_count"`
}

func GetNovelVolumeArray

func GetNovelVolumeArray(catalogueUrl string) ([]*Volume, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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