Skip to content

Commit

Permalink
Verify that username from remote scraper exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Wikidepia committed Jul 26, 2024
1 parent a572d06 commit 1a57335
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions handlers/scraper/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@ func (i *InstaData) ScrapeData() error {
return err
}
if err = binary.Unmarshal(remoteDecomp, i); err == nil {
slog.Info("Data parsed from remote scraper", "postID", i.PostID)
return nil
if len(i.Username) > 0 {
slog.Info("Data parsed from remote scraper", "postID", i.PostID)
return nil
}
}
}
slog.Error("Failed to scrape data from remote scraper", "postID", i.PostID, "status", res.StatusCode, "err", err)
Expand Down

0 comments on commit 1a57335

Please sign in to comment.