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

Can it get image from Instagram? #67

Open
bungandy opened this issue Jan 12, 2023 · 0 comments
Open

Can it get image from Instagram? #67

bungandy opened this issue Jan 12, 2023 · 0 comments

Comments

@bungandy
Copy link

This is what I got when try to load Instagram image
Screenshot 2023-01-12 at 18 26 03

/pages/api/image-proxy.js

import { withImageProxy } from '@blazity/next-image-proxy'

export default withImageProxy({
  whitelistedPatterns: [/^https?:\/\/(.*).cdninstagram.com/] 
})

/pages/index.js

const url = 'https://scontent-lax3-2.cdninstagram.com/v/t51.2885-15/317193037_1200508460548428_7875630962554406174_n.jpg?stp=dst-jpg_e35_p1080x1080&_nc_ht=scontent-lax3-2.cdninstagram.com&_nc_cat=100&_nc_ohc=EfCsI3Ie_UYAX_7GUFR&edm=APU89FABAAAA&ccb=7-5&oh=00_AfDX_6YrEWOEUpkP24VqWOnJSUG1qAomz_uv1PXrAiZvIQ&oe=63C4DD80&_nc_sid=86f79a'

<Image 
  className="object-cover"
  key={key}
  src={`/api/image-proxy?imageUrl=${url}`}
  alt={item.caption}
  width={500}
  height={500}
/>
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

1 participant