danbooru

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidDanbooruPostURL = errors.New("invalid danbooru post url")
	ErrDanbooruNoImage        = errors.New("danbooru post has no image")
)

Functions

func GetPostID

func GetPostID(url string) string

func Init

func Init()

Types

type Danbooru

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

func (*Danbooru) FetchNewArtworks

func (d *Danbooru) FetchNewArtworks(ctx context.Context, limit int) ([]*dto.FetchedArtwork, error)

func (*Danbooru) GetArtworkInfo

func (d *Danbooru) GetArtworkInfo(ctx context.Context, sourceURL string) (*dto.FetchedArtwork, error)

func (*Danbooru) MatchesSourceURL

func (d *Danbooru) MatchesSourceURL(text string) (string, bool)

func (*Danbooru) PrettyFileName

func (d *Danbooru) PrettyFileName(artwork shared.ArtworkLike, picture shared.PictureLike) string

PrettyFileName implements source.ArtworkSource.

type DanbooruFailJsonResp

type DanbooruFailJsonResp struct {
	Error   string `json:"error"`
	Message string `json:"message"`
	Success bool   `json:"success"`
}

type DanbooruJsonResp

type DanbooruJsonResp struct {
	DanbooruFailJsonResp
	TagString    string `json:"tag_string"`
	FileURL      string `json:"file_url"`
	LargeFileURL string `json:"large_file_url"`
	ID           int    `json:"id"`
	ImageWidth   int    `json:"image_width"`
	ImageHeight  int    `json:"image_height"`
}

func (*DanbooruJsonResp) ToArtwork

func (resp *DanbooruJsonResp) ToArtwork() (*dto.FetchedArtwork, error)

Jump to

Keyboard shortcuts

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