Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

[Fix] Wrong biography when passing sessionid #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marco97pa
Copy link

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

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

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 "viewier 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 beacuse Instagram returns different keys when logged in using a sessionid cookie.

Closes chris-greening#88
@Humoud
Copy link

Humoud commented Aug 29, 2021

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Always saves login users biography
2 participants