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

Always saves login users biography #88

Open
AdeBlanche opened this issue Feb 9, 2021 · 2 comments · May be fixed by #104
Open

Always saves login users biography #88

AdeBlanche opened this issue Feb 9, 2021 · 2 comments · May be fixed by #104

Comments

@AdeBlanche
Copy link

AdeBlanche commented Feb 9, 2021

Describe the bug
The biography returned is always that of the login user.

To Reproduce
Script that gives the wrong output:
from instascrape import *

SESSIONID = ' xxx '
headers = {"user-agent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Mobile Safari/537.36 Edg/87.0.664.57",
"cookie": f"sessionid={SESSIONID};"}
user = Profile("anna")
user.scrape(headers=headers)
print(user.username, " bio ", user.biography)

user = Profile("andreas")
user.scrape(headers=headers)
print(user.username, " bio ", user.biography)

output:
anna bio Login users text
andreas bio Login users text

Expected behavior
It should write out the bio of the individual users.

Desktop (please complete the following information):

  • OS: Centos 7
  • Latest Version of instascrape, 5th of feb

Thank you for a nice software.

@AgnesLL
Copy link

AgnesLL commented Feb 20, 2021

I have similar issue but it only outputs the bio of the logged in user (myself).

marco97pa added a commit to marco97pa/instascrape that referenced this issue Feb 28, 2021
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
@marco97pa marco97pa linked a pull request Feb 28, 2021 that will close this issue
4 tasks
@AdeBlanche
Copy link
Author

I made this change manually in my repository and it works very well. Waiting for a merge of the PR.
@chris-greening

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 a pull request may close this issue.

2 participants