pixiv

package
v0.0.0-...-3e94eb5 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Illust

type Illust struct {
	ID            string `json:"id"`
	IlustID       string `json:"illustId"`
	Title         string `json:"title"`
	IllustTitle   string `json:"illustTitle"`
	IllustComment string `json:"illustComment"`
	IllustType    int    `json:"illustType"`
	XRestrict     int    `json:"xRestrict"`
	Sl            int    `json:"sl"`
	URL           string `json:"url"`
	Pages         []IllustPage
	URLs          struct {
		Mini     string `json:"mini"`
		Thumb    string `json:"thumb"`
		Small    string `json:"small"`
		Regular  string `json:"regular"`
		Original string `json:"original"`
	} `json:"urls"`
	Description string `json:"description"`
	Tags        struct {
		AuthorID string      `json:"authorId"`
		IsLocked bool        `json:"isLocked"`
		Tags     []IllustTag `json:"tags"`
		Writable bool        `json:"writable"`
	} `json:"tags,omitempty"`

	UserID                  string `json:"userId"`
	UserName                string `json:"userName"`
	UserAccount             string `json:"userAccount"`
	Width                   int    `json:"width"`
	Height                  int    `json:"height"`
	PageCount               int    `json:"pageCount"`
	IsBookmarkable          bool   `json:"isBookmarkable"`
	Alt                     string `json:"alt"`
	IsAdContainer           bool   `json:"isAdContainer"`
	TitleCaptionTranslation struct {
		WorkTitle   string `json:"workTitle"`
		WorkCaption string `json:"workCaption"`
	} `json:"titleCaptionTranslation"`
	CreateDate      string `json:"createDate"`
	UpdateDate      string `json:"updateDate"`
	IsUnlisted      bool   `json:"isUnlisted"`
	ProfileImageURL string `json:"profileImageUrl"`
	// contains filtered or unexported fields
}

Illust .

func (*Illust) Complited

func (i *Illust) Complited() bool

Complited .

func (*Illust) TagsString

func (i *Illust) TagsString() (r string)

TagsString returns tags in one string separated by "," character

type IllustPage

type IllustPage struct {
	URLs struct {
		Mini     string `json:"mini"`
		Thumb    string `json:"thumb"`
		Small    string `json:"small"`
		Regular  string `json:"regular"`
		Original string `json:"original"`
	} `json:"urls"`
	Width  int `json:"width"`
	Height int `json:"height"`
}

IllustPage .

type IllustTag

type IllustTag struct {
	Tag         string `json:"tag"`
	Locked      bool   `json:"locked"`
	Deletable   bool   `json:"deletable"`
	UserID      string `json:"userId"`
	UserName    string `json:"userName"`
	Romaji      string `json:"romaji"`
	Translation struct {
		En string `json:"en"`
	} `json:"translation"`
}

IllustTag .

type Pixiv

type Pixiv struct {
	Ua string

	RetryCount      int
	ItemsPerRequest int
	WorkDirectory   string

	DownloadChannel chan Illust
	// contains filtered or unexported fields
}

Pixiv is API

func New

func New(cookies string, logFilePath string, threads int, xattrs bool) (p Pixiv)

New returns object with methods to access API functions

func (*Pixiv) Close

func (p *Pixiv) Close()

Close .

func (*Pixiv) ComplateIllust

func (p *Pixiv) ComplateIllust(illust *Illust) (err error)

ComplateIllust .

func (*Pixiv) ComplateIllustMultiple

func (p *Pixiv) ComplateIllustMultiple(illusts *[]Illust) (err error)

ComplateIllustMultiple .

func (*Pixiv) GetBookmarks

func (p *Pixiv) GetBookmarks(userID string) (illusts []Illust, err error)

GetBookmarks .

func (*Pixiv) GetFollows

func (p *Pixiv) GetFollows(userID string) (users []User, err error)

GetFollows .

func (*Pixiv) GetIllust

func (p *Pixiv) GetIllust(illustID string) (r Illust, err error)

GetIllust .

func (*Pixiv) GetUserIllustsID

func (p *Pixiv) GetUserIllustsID(userID string) (illusts []Illust, err error)

GetUserIllustsID .

func (*Pixiv) SetProxy

func (p *Pixiv) SetProxy(proxy string) (err error)

SetProxy sets SOCKS proxy for all requests

func (*Pixiv) TypicalFilenamesMatcher

func (p *Pixiv) TypicalFilenamesMatcher(name string) (ok bool, id string)

TypicalFilenamesMatcher matches typical pixiv's filenames. Returns ok if strings match and id extracted from string.

type User

type User struct {
	UserID          string `json:"userId"`
	UserName        string `json:"userName"`
	ProfileImageURL string `json:"profileImageUrl"`
	Following       bool   `json:"following"`
	Followed        bool   `json:"followed"`
	// contains filtered or unexported fields
}

User .

Jump to

Keyboard shortcuts

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