ScriptSmith / instamancer

Scrape Instagram's API with Puppeteer

Home Page:http://adamsm.com/instamancer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Locations are not supported any more

goooseman opened this issue · comments

Describe the bug
Instagram has made /explore/locations to be available only to logged-in users.

https://www.***.com/explore/locations/212988663 - here is the route, which is used by Instamancer. If you will open this route in your browser - it will ask to log in.

To Reproduce
instamancer location 212988663

OR

npm test -- -t "Library Classes"

Expected behavior
Location photos to be found

Output

 ● Library Classes › location

    expect(received).toBe(expected) // Object.is equality

    Expected: 10
    Received: 0

There is nothing we can do, unfortunately.

I can create a PR to remove this functionality and the tests, if you approve it.

Damn. Thanks for spotting this. I'll give it 24 hours, then I'll remove it myself.

Hi, does this mean that instamancer can no longer scrape location data or do we just need to login; i.e. I wont be able to run this via instaphyte:
instaphyte location 212988663 -c 200 --filetype csv

Because instamancer and instaphyte are intended for public data scraping, they cannot support location scraping because it is only available through signed-in accounts.

I've checked and the methods used by instamancer and instaphyte would both work with signed in accounts. They're released under the MIT license so you are allowed to copy both of these projects and modify them to work with signed-in accounts, however I cannot condone or support such usage.

Currently there is no way of doing this without writing some code yourself. For instaphyte I think the only difference would be that you'd need to use cookies when requesting data from the API here.

Surprisingly I couldn't find other tools that use the same API for locations as instaphyte so I don't think I can point you somewhere else.

In the future I'd consider adding a plugin system to instamancer allowing developers to listen for events that the scraper dispatches and implement extra functionality. However I think I'd need some other use-cases to consider adding that

Actually, instaloader does support signed-in location scraping. I'm not sure if it uses the same method that instaphyte did, but it should work.

No worries, happy to help