Documentation
¶
Index ¶
- Constants
- Variables
- func DoApi(ctx context.Context, method string, url string, body any) (*http.Response, []byte, error)
- func DownloadCoversIter(ctx context.Context, search *SearchResp) iter.Seq2[Image, error]
- func DownloadPagesIter(ctx context.Context, pages *PagesResp) iter.Seq2[Image, error]
- func SetThreads(n int)
- func SetToken(token string)
- func SetUseEnvProxy(b bool)
- type BaseResp
- type CategoriesResp
- type CategoryBase
- type CategoryLink
- type CategoryTag
- type Comic
- type ComicInfoResp
- type ComicsResp
- type CommentDoc
- type CommentsResp
- type DetailComic
- type Episode
- type EpsResp
- type Error
- type FavouriteResp
- type Image
- type ImageInfo
- type ImageType
- type KeywordsResp
- type LikeResp
- type PageDoc
- type PagesResp
- type RecommendationComic
- type RecommendationResp
- type SearchComic
- type SearchResp
- type SignInResp
- type Sort
- type Stats
- type User
- type UserFavouriteComic
- type UserFavouriteResp
Constants ¶
View Source
const ( API_URL = "https://picaapi.picacomic.com" API_AUTH_SIGNIN = "/auth/sign-in" API_COMICS_SEARCH = "/comics/advanced-search" API_COMICS = "/comics" API_KEYWORDS = "/keywords" // 紳士都在搜的關鍵字 API_CATEGORIES = "/categories" // 熱門分類 API_USERS_FAVOURITE = "/users/favourite" // 已收藏 IMG_STATIC = "/static" )
Variables ¶
View Source
var ( OrdersList = map[string]string{ "ua": "默认", "dd": "新到舊", "da": "舊到新", "ld": "最多愛心", "vd": "最多紳士指名", } CategoriesList = []string{ "嗶咔漢化", "全彩", "長篇", "同人", "短篇", "圓神領域", "碧藍幻想", "CG雜圖", "英語 ENG", "生肉", "純愛", "百合花園", "耽美花園", "偽娘哲學", "後宮閃光", "扶他樂園", "姐姐系", "妹妹系", "SM", "性轉換", "足の恋", "人妻", "NTR", "強暴", "非人類", "艦隊收藏", "Love Live", "SAO 刀劍神域", "Fate", "東方", "WEBTOON", "禁書目錄", "歐美", "Cosplay", "重口地帶", } )
Functions ¶
func DownloadCoversIter ¶
func DownloadPagesIter ¶
Types ¶
type CategoriesResp ¶
type CategoriesResp struct {
Categories []struct {
CategoryBase
CategoryLink
CategoryTag
}
}
type CategoryBase ¶
type CategoryLink ¶
type CategoryTag ¶
type Comic ¶
type Comic struct {
UnderlineId string `json:"_id"` // == .Id
Title string `json:"title"`
Author string `json:"author"`
TotalViews int `json:"totalViews"`
TotalLikes int `json:"totalLikes"`
PagesCount int `json:"pagesCount"`
EpsCount int `json:"epsCount"`
Finished bool `json:"finished"`
Categories []string `json:"categories"`
Tags []string `json:"tags"`
Thumb ImageInfo `json:"thumb"`
Id string `json:"id"`
LikesCount int `json:"likesCount"`
}
type ComicInfoResp ¶
type ComicInfoResp struct {
Comic DetailComic `json:"comic"`
}
type ComicsResp ¶
type CommentDoc ¶
type CommentsResp ¶
type CommentsResp struct {
Comments struct {
Docs []CommentDoc `json:"docs"`
Stats `json:",squash"`
} `json:"comments"`
}
type DetailComic ¶
type DetailComic struct {
Id string `json:"_id"`
Creator User `json:"creator"`
Title string `json:"title"`
Description string `json:"description"`
Thumb ImageInfo `json:"thumb"`
Author string `json:"author"`
ChineseTeam string `json:"chineseTeam"`
Categories []string `json:"categories"`
Tags []string `json:"tags"`
PagesCount int `json:"pagesCount"`
EpsCount int `json:"epsCount"`
Finished bool `json:"finished"`
UpdatedAt string `json:"updated_at"` // "2025-11-01T17:30:24.731Z"
CreatedAt string `json:"created_at"` // "2025-05-19T11:34:55.755Z"
AllowDownload bool `json:"allowDownload"`
AllowComment bool `json:"allowComment"`
TotalLikes int `json:"totalLikes"`
TotalViews int `json:"totalViews"`
TotalComments int `json:"totalComments"`
ViewsCount int `json:"viewsCount"`
LikesCount int `json:"likesCount"`
CommentsCount int `json:"commentsCount"`
IsFavourite bool `json:"isFavourite"`
IsLiked bool `json:"isLiked"`
}
type EpsResp ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error 附带了更详细的信息
pcErr := PicaComic.UnwarpErr(err) isXxx := pcErr.Is(PicaComic.ErrXXX)
-
type FavouriteResp ¶
type FavouriteResp struct {
Action string `json:"action"` // "favourite" | "un_favourite"
}
type ImageInfo ¶
type ImageInfo struct {
FileServer string `json:"fileServer"`
OriginalName string `json:"originalName"`
Path string `json:"path"`
}
type KeywordsResp ¶
type KeywordsResp struct {
Keywords []string `json:"keywords"`
}
type PagesResp ¶
type RecommendationComic ¶
type RecommendationComic struct {
Id string `json:"_id"`
Title string `json:"title"`
Author string `json:"author"`
PagesCount int `json:"pagesCount"`
EpsCount int `json:"epsCount"`
Finished bool `json:"finished"`
Categories []string `json:"categories"`
Thumb ImageInfo `json:"thumb"`
LikesCount int `json:"likesCount"`
}
type RecommendationResp ¶
type RecommendationResp struct {
Comics []RecommendationComic
}
func Recommendation ¶
func Recommendation(ctx context.Context, bookId string) (*RecommendationResp, error)
Recommendation 看了這本子的人也在看
type SearchComic ¶
type SearchComic struct {
UpdatedAt string `json:"updated_at"`
Thumb ImageInfo `json:"thumb"`
Author string `json:"author"`
Description string `json:"description"`
ChineseTeam string `json:"chineseTeam"`
CreatedAt string `json:"created_at"`
Finished bool `json:"finished"`
TotalViews int `json:"totalViews"`
Categories []string `json:"categories"`
TotalLikes int `json:"totalLikes"` // 有些本没有, 优先 {.LikesCount}
Title string `json:"title"`
Tags []string `json:"tags"`
Id string `json:"_id"`
LikesCount int `json:"likesCount"`
}
type SearchResp ¶
type SearchResp struct {
Comics struct {
Docs []SearchComic `json:"docs"`
Stats `json:",squash"`
} `json:"comics"`
}
type SignInResp ¶
type SignInResp struct {
Token string `json:"token"`
}
type User ¶
type User struct {
Id string `json:"_id"`
Gender string `json:"gender"` // "m" | "f"?
Name string `json:"name"`
Title string `json:"title"` // "WANDANCE"
Verified bool `json:"verified"`
Exp int `json:"exp"`
Level int `json:"level"`
Characters []string `json:"characters"` // "knight", "vip", "single_doc", "tool_man"
Role string `json:"role"` // "knight"
Avatar ImageInfo `json:"avatar"`
Slogan string `json:"slogan"` // 签名
}
type UserFavouriteComic ¶
type UserFavouriteComic struct {
Id string `json:"_id"`
Title string `json:"title"`
Author string `json:"author"`
TotalViews int `json:"totalViews"`
TotalLikes int `json:"totalLikes"`
PagesCount int `json:"pagesCount"`
EpsCount int `json:"epsCount"`
Finished bool `json:"finished"`
Categories []string `json:"categories"`
Tags []string `json:"tags"`
Thumb ImageInfo `json:"thumb"`
LikesCount int `json:"likesCount"`
}
type UserFavouriteResp ¶
type UserFavouriteResp struct {
Comics struct {
Docs []UserFavouriteComic `json:"docs"`
Stats `json:",squash"`
}
}
func UserFavourite ¶
UserFavourite 已收藏, page 可为 -1
Click to show internal directories.
Click to hide internal directories.