check if ScreenName in response is empty instead of Name, since Name can be unset by user.

This commit is contained in:
Michael 2021-01-25 21:57:01 +07:00
parent d33882ff94
commit 9bbc7aa2ab

View file

@ -51,7 +51,7 @@ func (s *Scraper) GetProfile(username string) (Profile, error) {
return Profile{}, fmt.Errorf("rest_id not found")
}
if jsn.Data.User.Legacy.Name == "" {
if jsn.Data.User.Legacy.ScreenName == "" {
return Profile{}, fmt.Errorf("either @%s does not exist or is private", username)
}