models

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Safe xRestrict = 0
	R18  xRestrict = 1
	R18G xRestrict = 2
)
View Source
const (
	Unrated aiType = 0
	NotAI   aiType = 1
	AI      aiType = 2
)

Variables

This section is empty.

Functions

func ProxyImage

func ProxyImage(URL string, target string) string

Types

type Comment

type Comment struct {
	AuthorID   string `json:"userId"`
	AuthorName string `json:"userName"`
	Avatar     string `json:"img"`
	Context    string `json:"comment"`
	Stamp      string `json:"stampId"`
	Date       string `json:"commentDate"`
}

func ProxyCommentsSlice

func ProxyCommentsSlice(comments []Comment, proxy string) []Comment

type FrequentTag

type FrequentTag struct {
	Name           string `json:"tag"`
	TranslatedName string `json:"tag_translation"`
}

type Illust

type Illust struct {
	ID              string        `json:"id"`
	Title           string        `json:"title"`
	Description     template.HTML `json:"description"`
	UserID          string        `json:"userId"`
	UserName        string        `json:"userName"`
	UserAccount     string        `json:"userAccount"`
	Date            time.Time     `json:"uploadDate"`
	Images          []Image       `json:"images"`
	Tags            []Tag         `json:"tags"`
	Pages           int           `json:"pageCount"`
	Bookmarks       int           `json:"bookmarkCount"`
	Likes           int           `json:"likeCount"`
	Comments        int           `json:"commentCount"`
	Views           int           `json:"viewCount"`
	CommentDisabled int           `json:"commentOff"`
	SanityLevel     int           `json:"sl"`
	XRestrict       xRestrict     `json:"xRestrict"`
	AiType          aiType        `json:"aiType"`
	User            UserShort
	RecentWorks     []IllustShort
	RelatedWorks    []IllustShort
	CommentsList    []Comment
	IsUgoira        bool
}

func (*Illust) ProxyImages

func (s *Illust) ProxyImages(proxy string)

type IllustShort

type IllustShort struct {
	ID           string        `json:"id"`
	Title        string        `json:"title"`
	Description  template.HTML `json:"description"`
	ArtistID     string        `json:"userId"`
	ArtistName   string        `json:"userName"`
	ArtistAvatar string        `json:"profileImageUrl"`
	Date         time.Time     `json:"uploadDate"`
	Thumbnail    string        `json:"url"`
	Pages        int           `json:"pageCount"`
	XRestrict    xRestrict     `json:"xRestrict"`
	AiType       aiType        `json:"aiType"`
}

func ProxyShortArtworkSlice

func ProxyShortArtworkSlice(artworks []IllustShort, proxy string) []IllustShort

type Image

type Image struct {
	Small    string `json:"thumb_mini"`
	Medium   string `json:"small"`
	Large    string `json:"regular"`
	Original string `json:"original"`
}

Pixiv gives us 5 types of an image. I don't need the mini one tho. PS: Where tf is my 360x360 image, Pixiv?

type ImageResponse

type ImageResponse struct {
	Urls map[string]string `json:"urls"`
}

type LandingArtworks

type LandingArtworks struct {
	Commissions     []IllustShort
	Following       []IllustShort
	Recommended     []IllustShort
	Newest          []IllustShort
	Rankings        []IllustShort
	Users           []IllustShort
	Pixivision      []Pixivision
	RecommendByTags []LandingRecommendByTags
}

type LandingRecommendByTags

type LandingRecommendByTags struct {
	Name     string `json:"tag"`
	Artworks []IllustShort
}

func ProxyRecommendedByTagsSlice

func ProxyRecommendedByTagsSlice(artworks []LandingRecommendByTags, proxy string) []LandingRecommendByTags

type PaginationData

type PaginationData struct {
	PreviousPage int
	CurrentPage  int
	NextPage     int
}

type PixivResponse

type PixivResponse struct {
	Error   bool
	Message string
	Body    json.RawMessage
}

type Pixivision

type Pixivision struct {
	ID        string `json:"id"`
	Title     string `json:"title"`
	Thumbnail string `json:"thumbnailUrl"`
	URL       string `json:"url"`
}

func ProxyPixivisionSlice

func ProxyPixivisionSlice(articles []Pixivision, proxy string) []Pixivision

type RankedArtwork

type RankedArtwork struct {
	ID           int    `json:"illust_id"`
	Title        string `json:"title"`
	Rank         int    `json:"rank"`
	Pages        string `json:"illust_page_count"`
	Image        string `json:"url"`
	ArtistID     int    `json:"user_id"`
	ArtistName   string `json:"user_name"`
	ArtistAvatar string `json:"profile_img"`
}

func ProxyRankedArtworkSlice

func ProxyRankedArtworkSlice(artworks []RankedArtwork, proxy string) []RankedArtwork

type RankingResponse

type RankingResponse struct {
	Artworks    []RankedArtwork `json:"contents"`
	Mode        string          `json:"mode"`
	Content     string          `json:"content"`
	CurrentDate string          `json:"date"`
	PrevDateRaw json.RawMessage `json:"prev_date"`
	NextDateRaw json.RawMessage `json:"next_date"`
	PrevDate    string
	NextDate    string
}

func (*RankingResponse) ProxyImages

func (s *RankingResponse) ProxyImages(proxy string)

type SearchArtworks

type SearchArtworks struct {
	Artworks []IllustShort `json:"data"`
	Total    int           `json:"total"`
}

type SearchResult

type SearchResult struct {
	Artworks SearchArtworks
	Popular  struct {
		Permanent []IllustShort `json:"permanent"`
		Recent    []IllustShort `json:"recent"`
	} `json:"popular"`
	RelatedTags []string `json:"relatedTags"`
}

func (*SearchResult) ProxyImages

func (s *SearchResult) ProxyImages(proxy string)

type Tag

type Tag struct {
	Name           string `json:"tag"`
	TranslatedName string `json:"translation"`
}

type TagDetail

type TagDetail struct {
	Name            string `json:"tag"`
	AlternativeName string `json:"word"`
	Metadata        struct {
		Detail string      `json:"abstract"`
		Image  string      `json:"image"`
		Name   string      `json:"tag"`
		ID     json.Number `json:"id"`
	} `json:"pixpedia"`
}

type TagResponse

type TagResponse struct {
	AuthorID string          `json:"authorId"`
	RawTags  json.RawMessage `json:"tags"`
}

type User

type User struct {
	ID              string        `json:"userId"`
	Name            string        `json:"name"`
	Avatar          string        `json:"imageBig"`
	BackgroundImage string        `json:"background"`
	Following       int           `json:"following"`
	MyPixiv         int           `json:"mypixivCount"`
	Comment         template.HTML `json:"commentHtml"`
	Artworks        []IllustShort `json:"artworks"`
	ArtworksCount   int
	FrequentTags    []FrequentTag
}

func (*User) ProxyImages

func (s *User) ProxyImages(proxy string)

type UserShort

type UserShort struct {
	ID     string `json:"userId"`
	Name   string `json:"name"`
	Avatar string `json:"imageBig"`
}

Jump to

Keyboard shortcuts

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