PiyushSuthar / toolzar

:zap: Toolzar is an open-source web app made using ̶R̶e̶a̶c̶t̶J̶S̶ ̶Preact :art:.
https://toolzar.netlify.app/
19 stars 8 forks source link

Instagram Video Downloader Not Working #8

Closed sujalgoel closed 3 years ago

sujalgoel commented 3 years ago

PiyushSuthar commented 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.

sujalgoel commented 3 years ago

Well, idk what to do either because the x-frame-options is denied image

PiyushSuthar commented 3 years ago

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.

sujalgoel commented 3 years ago

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);
})
PiyushSuthar commented 3 years ago

Can you share the cookie?

sujalgoel commented 3 years ago

well, that's my private cookie but you can visit this url and check the cookie from here image if ?__a=1 is not available then just refresh the page with developer tab open and you will see it.

PiyushSuthar commented 3 years ago

Thanks, Man! It's working now!!!

sujalgoel commented 3 years ago

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

PiyushSuthar commented 3 years ago

Thank You so much! You were of great help to this project!

The project is working like it was working initially.

sujalgoel commented 3 years ago

No worries! I am always available for help.