Documentation ¶
Index ¶
- Constants
- Variables
- type Snatch
- func (this *Snatch) Filter(filter, kw string) string
- func (this *Snatch) FindNovel(provider *models.SnatchRule, kw string) (*SnatchInfo, error)
- func (this *Snatch) GetChapter(provider *models.SnatchRule, rawurl string) (*SnatchInfo, error)
- func (this *Snatch) GetChapters(provider *models.SnatchRule, rawurl string) ([]*SnatchInfo, error)
- func (this *Snatch) GetNovel(provider *models.SnatchRule, rawurl string) (*SnatchInfo, error)
- func (this *Snatch) IsBookURL(provider *models.SnatchRule, rawurl string) bool
- func (this *Snatch) IsCrawlerURL(provider *models.SnatchRule, rawurl string) bool
- func (this *Snatch) Proxy(proxyFunc func() string)
- type SnatchInfo
Constants ¶
View Source
const ( // 默认分类 DEF_CATE_ID = 13 // 请求失败重试次数 RETRY = 5 )
Variables ¶
View Source
var ( ErrNotProvider = errors.New("没有获取到采集点") ErrNotResp = errors.New("没有返回") ErrNotRule = errors.New("没有采集规则") ErrNotNov = errors.New("获取小说失败") ErrNotURL = errors.New("没有传入URL地址") ErrNotNovName = errors.New("获取小说书名失败") ErrNotNovURL = errors.New("获取小说URL失败") ErrNotNovAuthor = errors.New("获取小说作者失败") ErrNotChapTitle = errors.New("获取小说章节标题失败") ErrNotFindURL = errors.New("没有配置搜索页URL地址") ErrInvalidURL = errors.New("无效的URL地址") )
Functions ¶
This section is empty.
Types ¶
type Snatch ¶
type Snatch struct {
// contains filtered or unexported fields
}
func (*Snatch) FindNovel ¶
func (this *Snatch) FindNovel(provider *models.SnatchRule, kw string) (*SnatchInfo, error)
查找小说
func (*Snatch) GetChapter ¶
func (this *Snatch) GetChapter(provider *models.SnatchRule, rawurl string) (*SnatchInfo, error)
获取小说章节内容
func (*Snatch) GetChapters ¶
func (this *Snatch) GetChapters(provider *models.SnatchRule, rawurl string) ([]*SnatchInfo, error)
获取小说章节列表
func (*Snatch) GetNovel ¶
func (this *Snatch) GetNovel(provider *models.SnatchRule, rawurl string) (*SnatchInfo, error)
获取一本小说
func (*Snatch) IsBookURL ¶
func (this *Snatch) IsBookURL(provider *models.SnatchRule, rawurl string) bool
是否小说简介页面
func (*Snatch) IsCrawlerURL ¶
func (this *Snatch) IsCrawlerURL(provider *models.SnatchRule, rawurl string) bool
是否小说是否爬虫页面
Click to show internal directories.
Click to hide internal directories.