Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login required for locations as of 04/2022 #3

Closed
do-me opened this issue Aug 26, 2021 · 3 comments
Closed

Login required for locations as of 04/2022 #3

do-me opened this issue Aug 26, 2021 · 3 comments

Comments

@do-me
Copy link
Owner

do-me commented Aug 26, 2021

After recent changes, the old endpoints, e.g.:

https://instagram.com/graphql/query/?query_hash=ac38b90f0f3981c42092016a37c59bf7&variables={"id":"<some_location_id>","first":50,"after":""}

seem not to work anymore.

However location IDs can still be mined successfully via a different endpoint:

https://www.instagram.com/explore/locations/<some_location_id>/?__a=1&max_id=<last_cursor>

Currently don't have time to investigate further but this quick fix works for me:

  1. Change lines 47-49 to:
    if location_or_hashtag == "location":
        instalink = 'https://www.instagram.com/explore/locations/' + str(object_id_or_string) + '/?__a=1&max_id=' + cursor 
        return instalink
  1. Due to different JSON respone replace all idata["data"] with idata["graphql"].

Same applies to hashtags. Just updated the code so hashtags can be mined again.

@arifluthfi16
Copy link

arifluthfi16 commented Jan 26, 2022

Hey man, this is an appreciation comment of how amazing this implementation is :D thank you very much i learned a lot!

This repo is definitely underrated!

@do-me do-me changed the title [Solved] Login required for old endpoints - Fix for location IDs Login required for locations as of 04/2022 Apr 23, 2022
@do-me
Copy link
Owner Author

do-me commented Apr 23, 2022

Locations cannot be retrieved anymore without login. Hashtags as of 04/2022 still do work without login but seldomly in TOR (you must be lucky to hit a good endpoint), e.g.

but it might be only a matter of time until it's going to be closed entirely (without login).

However, posts seem to be consistently publicly available (maybe even for a longer time to positive Instagram SEO). Hence, I propose

  1. Mining location or hashtag sites with Instagram Scraper with login (at a reduced pace obviously).
  2. If needed re-mine single posts with fast-instagram-scraper but in a tweaked version for posts only. This would require some slight changes which are not implemented yet.

I described it here as well.

do-me added a commit that referenced this issue Apr 23, 2022
Hashtags can still be mined (with enough patience, partially solves #3). Location sites however unfortunately not.
@do-me
Copy link
Owner Author

do-me commented Aug 3, 2022

Works again for some reason, test e.g. here. Closing for now.

@do-me do-me closed this as completed Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants