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

Cross origin errors #278

Open
michaelpumo opened this issue Dec 7, 2021 · 4 comments
Open

Cross origin errors #278

michaelpumo opened this issue Dec 7, 2021 · 4 comments

Comments

@michaelpumo
Copy link

I'm not sure this is a problem with the library itself but requesting media found via the API, I get cross origin errors:

await client.login()

const photos = await client.getPhotosByUsername({
  username: 'mothanimation',
  first: 100,
})

const payload = photos.user.edge_owner_to_timeline_media

This gives me back a payload but images like:
https://scontent-lcy1-2.cdninstagram.com/v/t51.2885-15/e15/s640x640/121419114_1251508065183762_3118685974291002946_n.jpg?_nc_ht=scontent-lcy1-2.cdninstagram.com&_nc_cat=106&_nc_ohc=X-g5qNrJVpAAX-QUNky&tn=l7oAA9r1W5sgJerz&edm=APU89FABAAAA&ccb=7-4&oh=e8008ba4fa711bd45eb15726e25ea726&oe=61B23A03&_nc_sid=86f79a

...are not able to be served from another website back to the user. Only viewing directly works (because its on their own domain).

Is this a known limitation? Is there any scope to work around this with the library?

Thanks

@MonsieurBibo
Copy link

Don't use this library. It is not maintained any more and might lead to a ban.

@SupaMario123
Copy link

@MonsieurBibo can you recommend any other library?

@MonsieurBibo
Copy link

You can try instagram-private-api, it's more complex but way more complete.

@michaelpumo
Copy link
Author

I actually end up using the Instagram Basic Display API through Facebook Developers area.

They don't make it easy or straight-forward to understand but I managed to get it up and running following this video:
https://www.youtube.com/watch?v=cX8_YqqG6-Y

It works much faster than this library anyway, since you don't need to be logging into your account (which is slow). Hope this helps someone.

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

3 participants