yandere

package
v0.72.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidYanderePostURL = errors.New("invalid yandere post url")
	ErrYandereAPIError       = errors.New("yandere api error")
)

Functions

func GetPostID

func GetPostID(url string) string

Types

type Yandere

type Yandere struct{}

func (*Yandere) Config

func (y *Yandere) Config() *config.SourceCommonConfig

func (*Yandere) FetchNewArtworks

func (y *Yandere) FetchNewArtworks(limit int) ([]*types.Artwork, error)

func (*Yandere) FetchNewArtworksWithCh

func (y *Yandere) FetchNewArtworksWithCh(artworkCh chan *types.Artwork, limit int) error

func (*Yandere) GetArtworkInfo

func (y *Yandere) GetArtworkInfo(sourceURL string) (*types.Artwork, error)

func (*Yandere) GetCommonSourceURL

func (y *Yandere) GetCommonSourceURL(url string) string

func (*Yandere) GetFileName

func (y *Yandere) GetFileName(artwork *types.Artwork, picture *types.Picture) string

func (*Yandere) GetPictureInfo

func (y *Yandere) GetPictureInfo(sourceURL string, _ uint) (*types.Picture, error)

func (*Yandere) GetSourceURLRegexp

func (y *Yandere) GetSourceURLRegexp() *regexp.Regexp

func (*Yandere) Init

func (y *Yandere) Init(s types.Service)

type YandereJsonResp

type YandereJsonResp []YanderePostJsonResp

func (YandereJsonResp) ToArtwork

func (resp YandereJsonResp) ToArtwork() *types.Artwork

type YanderePostJsonResp

type YanderePostJsonResp struct {
	ID        int    `json:"id"`
	Tags      string `json:"tags"`
	Author    string `json:"author"`
	Source    string `json:"source"`     // title, maybe?
	FileURL   string `json:"file_url"`   // original
	SampleURL string `json:"sample_url"` // thumbnail
	Width     int    `json:"width"`
	Height    int    `json:"height"`
	ParentID  int    `json:"parent_id"`
}

Jump to

Keyboard shortcuts

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