postaddictme / instagram-php-scraper

Get account information, photos, videos, stories and comments.
https://packagist.org/packages/raiym/instagram-php-scraper
MIT License
3.07k stars 800 forks source link

getAccount() fixed to get all missing user data. #1118

Open Dgbusiness opened 1 year ago

Dgbusiness commented 1 year ago

Hi I have been using your repo and I noticed that doing getOwner() on a media type object returned the user with very little information than it should have initially.

Investigating several of the open issues I found that the sharedResponse object is no longer being returned when requesting user information.

So, to somehow solve my problem and get all the user account information, I modified the endpoint to get the user account information (ACCOUNT_PAGE) and made some modifications to process the new response.

With these changes you can now get the missing user information from getOwner() using getAccount($username) (and the username may well be obtained from getOwner as it is one of the few fields it does return).

I hope it can help someone else.

PS: the change of $maxId is because sometimes it triggers Undeffined index, if so, it is placed as an empty string and works without problems.

GooseBumpsOS commented 1 year ago

Thank you, it's work fine for me