Closed sujalgoel closed 3 years ago
Thanks for reporting this issue.
I have noted that instagram has become strict with their CORS policies. That's why it's not possible for us to download images and videos this way. I'm still trying to find a way to bypass it.
If you have any idea and can contribute.
Well, idk what to do either because the x-frame-options is denied
Maybe I should switch this project to nextjs and have an API route to scrape out Instagram for videos and stuff. I shall start working on it when time permits.
well, for my Discord bot I am using their api only but I am just adding the cookie in the headers while fetching, if we could do the same for the image then it would be great 👍
fetch('https: //www.instagram.com/${username}/?__a=1', {
headers: {
'cookie': COOKIE
}
}).then(res => res.json()).then(data => {
console.log(data);
})
Can you share the cookie?
well, that's my private cookie
but you can visit this url and check the cookie from here
if ?__a=1
is not available then just refresh the page with developer tab open and you will see it.
Thanks, Man! It's working now!!!
Also, use this instagram-bypasser by me!
https://instagram-bypass.vercel.app/convert?url=THE_POST_IMAGE_URL_FROM_HERE, https://www.instagram.com/${USERNAME}/?__a=1
The URL must be encoded.
You can also download video by sending the video URL as url
query.
Example: https://instagram-bypass.vercel.app/convert?url=https%3A%2F%2Finstagram.fdel31-1.fna.fbcdn.net%2Fv%2Ft50.2886-16%2F199472152_544716073360574_427940837169656149_n.mp4%3F_nc_ht%3Dinstagram.fdel31-1.fna.fbcdn.net%26_nc_cat%3D102%26_nc_ohc%3DXvlI_-9UChMAX9N3_6e%26tn%3DKm6pKZOObMnZ-obr%26edm%3DAABBvjUBAAAA%26ccb%3D7-4%26oe%3D60C5EDD5%26oh%3D7bddff94a216cab1637b223fab8cd4fc%26_nc_sid%3D83d603
Thank You so much! You were of great help to this project!
The project is working like it was working initially.
No worries! I am always available for help.