Skip to content

Commit

Permalink
fix: danbooru
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Nov 19, 2023
1 parent 61168ad commit 54c67e3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/danbooru/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package deepdanbooru
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"image"
"net/url"
Expand Down Expand Up @@ -59,8 +60,12 @@ func tagurl(name, u string) (im image.Image, st *sorttags, err error) {
if err != nil {
return
}
if len(data) < 4 {
err = errors.New("data too short")
return
}
tags := make(map[string]float64)
err = json.Unmarshal(data, &tags)
err = json.Unmarshal(data[1:len(data)-1], &tags)
if err != nil {
return
}
Expand Down

0 comments on commit 54c67e3

Please sign in to comment.