Skip to content

Commit

Permalink
fix: error handling (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
XangelMusic authored Dec 18, 2023
1 parent 03161b9 commit 63f1947
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions artworks/pixiv/pixiv.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,15 @@ func (p *Pixiv) _find(id string) (artworks.Artwork, error) {
proxy: p.proxyHost,
}

if artwork.Images[0].Original == "https://s.pximg.net/common/images/limit_sanity_level_360.png" {
return nil, artworks.ErrRateLimited
errImages := []string{
"limit_sanity_level_360.png",
"limit_unknown_360.png",
}

for _, img := range errImages {
if artwork.Images[0].Original == fmt.Sprintf("https://s.pximg.net/common/images/%s", img) {
return nil, artworks.ErrRateLimited
}
}

if illust.IllustAIType == pixiv.IllustAITypeAIGenerated {
Expand Down

0 comments on commit 63f1947

Please sign in to comment.