Skip to content

Commit

Permalink
Remove unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikidepia committed Feb 21, 2025
1 parent 1082e03 commit b739058
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
6 changes: 3 additions & 3 deletions handlers/scraper/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (i *InstaData) parseTimeSliceImpl(embedBody []byte) error {
if tt == js.StringToken && bytes.Contains(text, []byte("shortcode_media")) {
// Strip quotes from start and end
text = text[1 : len(text)-1]
unescapeData := utils.UnescapeJSONString(utils.B2S(text))
unescapeData := utils.UnescapeJSONString(string(text))
if !gjson.Valid(unescapeData) {
return errors.New("failed to parse data from TimeSliceImpl")
}
Expand Down Expand Up @@ -387,14 +387,14 @@ func GetData(postID string) (*InstaData, error) {
if dataBucket == nil {
return nil
}
dataBucket.Put(utils.S2B(item.PostID), bb)
dataBucket.Put([]byte(item.PostID), bb)

ttlBucket := tx.Bucket([]byte("ttl"))
if ttlBucket == nil {
return nil
}
expTime := strconv.FormatInt(time.Now().Add(24*time.Hour).UnixNano(), 10)
ttlBucket.Put(utils.S2B(expTime), utils.S2B(item.PostID))
ttlBucket.Put([]byte(expTime), []byte(item.PostID))
return nil
})
if err != nil {
Expand Down
11 changes: 0 additions & 11 deletions utils/strconv.go

This file was deleted.

0 comments on commit b739058

Please sign in to comment.