postaddictme / instagram-php-scraper

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

Get comments error #523

Closed lewbor closed 5 years ago

lewbor commented 5 years ago

Threre is a 403 response while getting the comments using getMediaCommentsByCode() method. After debugging I find a some reasons for it: 1) Invalid query_hash request parameter (possible it changed) 2) No cookies. New endpoint requres a session cookies, but when makiing first request no cookies is set (need to call getMediaById() first to set cookies) 3) old response key was "edge_media_to_comment" but new is "edge_media_to_parent_comment"

benlumley commented 5 years ago

Looking at this, you appear to need the x-csrftoken set now, even when not logged in... quick testing suggests it doesn't matter what it's set to.

benlumley commented 5 years ago

This PR gets media loading again https://github.com/postaddictme/instagram-php-scraper/pull/524

sportakal commented 5 years ago

Is that way solve? I still get 403

pgrimaud commented 5 years ago

@sportakal You just have to wait for the approval of PR.

benlumley commented 5 years ago

@sportakal You just have to wait for the approval of PR.

Or reference my repo in composer.json - https://getcomposer.org/doc/05-repositories.md#loading-a-package-from-a-vcs-repository

This in repositories:

        {
            "type": "vcs",
            "url": "https://github.com/benlumley/instagram-php-scraper"
        }

and then

        "raiym/instagram-php-scraper": "dev-master@dev"
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.