chris-greening / instascrape

Powerful and flexible Instagram scraping library for Python, providing easy-to-use and expressive tools for accessing data programmatically
https://chris-greening.github.io/instascrape/
MIT License
630 stars 107 forks source link

[Fix] Wrong biography when passing sessionid #104

Open marco97pa opened 3 years ago

marco97pa commented 3 years ago

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_urland user_profile_pic_urlkeys.
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

Humoud commented 3 years ago

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.