Fix 403 error

This commit is contained in:
Alexander Sheiko 2023-05-11 13:36:32 +03:00
parent 848bdfd3cf
commit 3eb86161ce

3
api.go
View file

@ -53,8 +53,7 @@ func (s *Scraper) RequestAPI(req *http.Request, target interface{}) error {
return err
}
// private profiles return forbidden, but also data
if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusForbidden {
if resp.StatusCode != http.StatusOK {
return fmt.Errorf("response status %s: %s", resp.Status, content)
}