instascrape
instascrape copied to clipboard
[Fix] Wrong biography when passing sessionid
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
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.