instascrape icon indicating copy to clipboard operation
instascrape copied to clipboard

[Fix] Wrong biography when passing sessionid

Open marco97pa opened this issue 4 years ago • 1 comments

Description

When a sessionid is passed to the Profile.scrape() function, the scraped profile contains a wrong biography.
Instead of getting the biography of the Profile asked, it returns the biography of the account associated to the sessionid (the "viewer user").

The fix maps the key biography to user_biography. This fix is similar to the profile_pic_url and user_profile_pic_url keys.
This is needed because Instagram returns different keys when logged in using a sessionid cookie. The right keys are the same but preceded by user_

Closes #88

Checklist

  • [x] I followed the guidelines in our Contributing document
  • [x] I added an explanation of my changes
  • [ ] I have written new tests for my changes, as applicable
  • [x] I successfully ran tests with my changes locally

marco97pa avatar Feb 28 '21 11:02 marco97pa

Thank you for this PR. I was facing this exact issue and your fix worked. I would also like to mention that I was facing a similar issue with the "external_url" field. I fixed it by adding mapping["external_url"] = deque(["user_external_url"]) under the line which you added in this PR.

Humoud avatar Aug 29 '21 17:08 Humoud