Documentation ¶
Index ¶
- Variables
- type Bilibili
- func (b *Bilibili) Config() *config.SourceCommonConfig
- func (b *Bilibili) FetchNewArtworks(limit int) ([]*types.Artwork, error)
- func (b *Bilibili) FetchNewArtworksWithCh(artworkCh chan *types.Artwork, limit int) error
- func (b *Bilibili) GetArtworkInfo(sourceURL string) (*types.Artwork, error)
- func (b *Bilibili) GetCommonSourceURL(url string) string
- func (b *Bilibili) GetFileName(artwork *types.Artwork, picture *types.Picture) string
- func (b *Bilibili) GetPictureInfo(sourceURL string, index uint) (*types.Picture, error)
- func (b *Bilibili) GetSourceURLRegexp() *regexp.Regexp
- func (b *Bilibili) Init()
- type BilibiliApiData
- type BilibiliApiItem
- type BilibiliApiModuleAuthor
- type BilibiliApiModuleDynamic
- type BilibiliApiPic
- type BilibiliApiResp
- type BilibiliApiSummary
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRequestFailed = errors.New("request bilibili dynamic url failed") ErrIndexOOB = errors.New("index out of artwork pictures bounds") ErrInvalidURL = errors.New("invalid bilibili dynamic url") )
View Source
var ReqClient *req.Client
Functions ¶
This section is empty.
Types ¶
type Bilibili ¶
type Bilibili struct{}
func (*Bilibili) Config ¶
func (b *Bilibili) Config() *config.SourceCommonConfig
func (*Bilibili) FetchNewArtworks ¶
func (*Bilibili) FetchNewArtworksWithCh ¶
func (*Bilibili) GetArtworkInfo ¶
func (*Bilibili) GetCommonSourceURL ¶
func (*Bilibili) GetFileName ¶
func (*Bilibili) GetPictureInfo ¶
func (*Bilibili) GetSourceURLRegexp ¶
type BilibiliApiData ¶
type BilibiliApiData struct {
Item *BilibiliApiItem `json:"item"`
}
type BilibiliApiItem ¶
type BilibiliApiItem struct { Modules *struct { ModuleAuthor *BilibiliApiModuleAuthor `json:"module_author"` ModuleDynamic *BilibiliApiModuleDynamic `json:"module_dynamic"` } `json:"modules"` Type string `json:"type"` IdStr string `json:"id_str"` }
type BilibiliApiModuleAuthor ¶
type BilibiliApiModuleDynamic ¶
type BilibiliApiModuleDynamic struct { Major *struct { Opus *struct { Pics []*BilibiliApiPic `json:"pics"` Summary *BilibiliApiSummary `json:"summary"` Title string `json:"title"` } `json:"opus"` Type string `json:"type"` } `json:"major"` }
type BilibiliApiPic ¶
type BilibiliApiResp ¶
type BilibiliApiResp struct { Code int `json:"code"` Message string `json:"message"` TTL int `json:"ttl"` Data *BilibiliApiData `json:"data"` }
type BilibiliApiSummary ¶
type BilibiliApiSummary struct {
Text string `json:"text"`
}
Click to show internal directories.
Click to hide internal directories.