pixiv

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 17 Imported by: 14

Documentation

Overview

Package pixiv pixiv相关api

Index

Constants

View Source
const CacheDir = "data/pixiv/"

CacheDir ...

Variables

This section is empty.

Functions

This section is empty.

Types

type Generate added in v1.7.0

type Generate struct {
	Success  bool   `json:"success"`
	ErrorMsg string `json:"error"`
	ID       int    `json:"id"`
	Title    string `json:"title"`
	Artist   struct {
		ID   int    `json:"id"`
		Name string `json:"name"`
	} `json:"artist"`
	Multiple          bool     `json:"multiple"`
	OriginalURL       string   `json:"original_url"`
	OriginalURLProxy  string   `json:"original_url_proxy"`
	OriginalUrls      []string `json:"original_urls"`
	OriginalUrlsProxy []string `json:"original_urls_proxy"`
	Thumbnails        []string `json:"thumbnails"`
}

Generate API 返回结果

func Cat added in v1.7.0

func Cat(id int64) (*Generate, error)

Cat 调用 pixiv.cat 的 generate API

type Illust

type Illust struct {
	Pid         int64    `db:"pid"`
	Title       string   `db:"title"`
	Caption     string   `db:"caption"`
	Tags        string   `db:"tags"`
	ImageUrls   []string `db:"image_urls"`
	AgeLimit    string   `db:"age_limit"`
	CreatedTime string   `db:"created_time"`
	UserID      int64    `db:"user_id"`
	UserName    string   `db:"user_name"`
}

Illust 插画结构体

func Works

func Works(id int64) (i *Illust, err error)

Works 获取插画信息

func (*Illust) Download added in v1.2.5

func (i *Illust) Download(page int, path string) error

Download 多线程下载 page 页到 filepath, 返回 error

func (*Illust) DownloadToCache added in v1.2.5

func (i *Illust) DownloadToCache(page int) error

DownloadToCache 多线程下载第 page 页到 i.Path(page), 返回 error

func (*Illust) Path added in v1.3.0

func (i *Illust) Path(page int) string

Path 图片本地缓存路径

type RankValue

type RankValue struct {
	/* required, possible rank modes:
		- daily (default)
	    - weekly
	    - monthly
	    - rookie
	    - original
	    - male
	    - female
	    - daily_r18
	    - weekly_r18
	    - male_r18
	    - female_r18
	    - r18g
	*/
	Mode string
	/* optional, possible rank type:
	    - all (default)
	    - illust
		- ugoira
		- manga
	*/
	Type string
	Page int
	Date string
}

RankValue 搜索元素

func (RankValue) Rank

func (value RankValue) Rank() (r [18]int, err error)

Rank 画作排行榜

Jump to

Keyboard shortcuts

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